home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / m2 / m2_part1.lha / modula / src / Intuition.def < prev    next >
Text File  |  1994-07-30  |  131KB  |  3,231 lines

  1. DEFINITION FOR LIBRARY MODULE Intuition ;
  2.  
  3. FROM SYSTEM    IMPORT ADDRESS, STRING, SHORTSET, LONGSET ;
  4. FROM Utility    IMPORT TagItem, TagItemPtr, TAG_USER, Hook, HookPtr ;
  5. FROM KeyMap    IMPORT KeyMapPtr ;
  6. FROM Timer    IMPORT timeval ;
  7.  
  8. FROM Exec    IMPORT Node, Message, TaskPtr, Library, MsgPortPtr,
  9.                ListPtr, MinNode ;
  10.  
  11. FROM Graphics    IMPORT LayerPtr, View, ViewPtr, ViewPortPtr, RastPortPtr,
  12.                RastPort, BitMap, BitMapPtr, TextAttrPtr, TextFontPtr,
  13.                Layer_Info, DBufInfoPtr, RectanglePtr, JAM2 ;
  14.  
  15. FROM InputEvent IMPORT IECODE_LBUTTON, IECODE_RBUTTON, IECODE_UP_PREFIX,
  16.                IECODE_MBUTTON, IEQUALIFIER_LALT, IEQUALIFIER_RALT,
  17.                IEQUALIFIER_LCOMMAND, IEQUALIFIER_RCOMMAND,
  18.                InputEventPtr ;
  19. IMPORT Graphics ;
  20.  
  21. TYPE
  22.   MenuPtr        = POINTER TO Menu ;
  23.   MenuItemPtr        = POINTER TO MenuItem ;
  24.   RequesterPtr        = POINTER TO Requester ;
  25.   GadgetPtr        = POINTER TO Gadget ;
  26.   ExtGadgetPtr        = POINTER TO ExtGadget ;
  27.   BoolInfoPtr        = POINTER TO BoolInfo ;
  28.   PropInfoPtr        = POINTER TO PropInfo ;
  29.   StringInfoPtr        = POINTER TO StringInfo ;
  30.   IntuiTextPtr        = POINTER TO IntuiText ;
  31.   BorderPtr        = POINTER TO Border ;
  32.   ImagePtr        = POINTER TO Image ;
  33.   IntuiMessagePtr    = POINTER TO IntuiMessage ;
  34.   ExtIntuiMessagePtr    = POINTER TO ExtIntuiMessage ;
  35.   IBoxPtr        = POINTER TO IBox ;
  36.   WindowPtr        = POINTER TO Window ;
  37.   NewWindowPtr        = POINTER TO NewWindow ;
  38.   ExtNewWindowPtr    = POINTER TO ExtNewWindow ;
  39.   DrawInfoPtr        = POINTER TO DrawInfo ;
  40.   ScreenPtr        = POINTER TO Screen ;
  41.   NewScreenPtr        = POINTER TO NewScreen ;
  42.   ExtNewScreenPtr    = POINTER TO ExtNewScreen ;
  43.   ScreenBufferPtr    = POINTER TO ScreenBuffer ;
  44.   PreferencesPtr    = POINTER TO Preferences ;
  45.   RememberPtr        = POINTER TO Remember ;
  46.   ColorSpecPtr        = POINTER TO ColorSpec ;
  47.   EasyStructPtr        = POINTER TO EasyStruct ;
  48.   TabletDataPtr        = POINTER TO TabletData ;
  49.   TabletHookDataPtr    = POINTER TO TabletHookData ;
  50.   StringExtendPtr    = POINTER TO StringExtend ;
  51.   SGWorkPtr        = POINTER TO SGWork ;
  52.   GadgetInfoPtr        = POINTER TO GadgetInfo ;
  53.   PGXPtr        = POINTER TO PGX ;
  54.   IntuitionBasePtr    = POINTER TO IntuitionBaseRec ;
  55.  
  56. (* ========================================================================== *)
  57. (* === Menu ================================================================= *)
  58. (* ========================================================================== *)
  59.  
  60. TYPE
  61.   Menu = RECORD
  62.     NextMenu    : MenuPtr ;    (* same level            *)
  63.     LeftEdge    : INTEGER ;
  64.     TopEdge    : INTEGER ;    (* position of the select box    *)
  65.     Width    : INTEGER ;
  66.     Height    : INTEGER ;    (* dimensions of the select box *)
  67.     Flags    : BITSET  ;    (* see flag definitions below    *)
  68.     MenuName    : STRING  ;    (* text for this Menu Header    *)
  69.     FirstItem   : MenuItemPtr ; (* pointer to first in chain    *)
  70.  
  71.     JazzX,JazzY    : INTEGER ;     (* these mysteriously-named variables *)
  72.     BeatX,BeatY    : INTEGER ;        (* are for internal use only          *)
  73.   END ;
  74.  
  75. CONST
  76.   (* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION *)
  77.   MENUENABLED    = {0} ;    (* whether or not this menu is enabled     *)
  78.  
  79.   (* FLAGS SET BY INTUITION *)
  80.   MIDRAWN    = {8} ;    (* this menu's items are currently drawn *)
  81.  
  82. (* ========================================================================== *)
  83. (* === MenuItem ============================================================= *)
  84. (* ========================================================================== *)
  85.  
  86. TYPE
  87.   MenuItem = RECORD
  88.     NextItem    : MenuItemPtr ;    (* pointer to next in chained list     *)
  89.     LeftEdge    : INTEGER ;
  90.     TopEdge    : INTEGER ;    (* position of the select box         *)
  91.     Width    : INTEGER ;
  92.     Height    : INTEGER ;    (* dimensions of the select box         *)
  93.     Flags    : BITSET  ;    (* see the defines below         *)
  94.  
  95.     MutualExclude : LONGSET ;    (* set bits mean this item excludes that *)
  96.     ItemFill      : ADDRESS ;    (* points to Image, IntuiText, or NULL   *)
  97.  
  98.     (* when this item is pointed to by the cursor and the items highlight  *)
  99.     (*    mode HIGHIMAGE is selected, this alternate image will be displayed *)
  100.  
  101.     SelectFill    : ADDRESS  ;    (* points to Image, IntuiText, or NULL       *)
  102.     Command    : SHORTINT ;    (* only if appliprog sets the COMMSEQ flag *)
  103.     SubItem    : MenuItemPtr ;    (* if non-zero, points to MenuItem for submenu*)
  104.  
  105.     (* The NextSelect field represents the menu number of next selected *)
  106.     (*    item (when user has drag-selected several items)        *)
  107.  
  108.     NextSelect    : CARDINAL ;
  109. END ;
  110.  
  111. CONST
  112.   (* FLAGS SET BY THE APPLIPROG *)
  113.   CHECKIT    = {0} ; (* set to indicate checkmarkable item        *)
  114.   ITEMTEXT    = {1} ;    (* set if textual, clear if graphical item    *)
  115.   COMMSEQ    = {2} ;    (* set if there's an command sequence        *)
  116.   MENUTOGGLE    = {3} ;    (* set for toggling checks (else mut. exclude)    *)
  117.   ITEMENABLED    = {4} ;    (* set if this item is enabled            *)
  118.  
  119.   (* these are the SPECIAL HIGHLIGHT FLAG state meanings        *)
  120.   HIGHFLAGS    = {6,7};(* see definitions below for these bits        *)
  121.   HIGHIMAGE    = {};    (* use the user's "select image"        *)
  122.   HIGHCOMP    = {6} ;    (* highlight by complementing the selectbox    *)
  123.   HIGHBOX    = {7} ;    (* highlight by "boxing" the selectbox        *)
  124.   HIGHNONE    = {6,7};(* don't highlight                *)
  125.  
  126.   (* FLAGS SET BY BOTH APPLIPROG AND INTUITION *)
  127.   CHECKED    = {8} ;    (* state of the checkmark *)
  128.  
  129.   (* FLAGS SET BY INTUITION *)
  130.   ISDRAWN    = {12} ; (* this item's subs are currently drawn *)
  131.   HIGHITEM    = {13} ; (* this item is currently highlighted     *)
  132.   MENUTOGGLED    = {14} ; (* this item was already toggled     *)
  133.  
  134. (* ========================================================================== *)
  135. (* === Requester ============================================================ *)
  136. (* ========================================================================== *)
  137.  
  138. TYPE
  139.   Requester = RECORD
  140.     OlderRequest: RequesterPtr ;
  141.     LeftEdge    : INTEGER ;
  142.     TopEdg    : INTEGER ; (* dimensions of the entire box    *)
  143.     Width    : INTEGER ;
  144.     Heighy    : INTEGER ; (* dimensions of the entire box    *)
  145.     RelLeft    : INTEGER ;
  146.     RelTop    : INTEGER ; (* for Pointer relativity offsets    *)
  147.  
  148.     ReqGadget    : GadgetPtr   ;    (* pointer to a list of Gadgets *)
  149.     ReqBorder    : BorderPtr   ;    (* the box's border        *)
  150.     ReqText    : IntuiTextPtr;    (* the box's text        *)
  151.     Flags    : BITSET      ;    (* see definitions below    *)
  152.  
  153.     BackFill    : SHORTCARD ; (* pen number for back-plane fill before draws *)
  154.     ReqLayer    : LayerPtr  ; (* Layer in place of clip rect             *)
  155.  
  156.     ReqPad1    : ARRAY [0..31] OF SHORTCARD ;
  157.  
  158.     (* If the BitMap plane pointers are non-zero, this tells the system  *)
  159.     (* that the image comes pre-drawn (if the appliprog wants to define  *)
  160.     (* its own box, in any shape or size it wants!);  this is OK by     *)
  161.     (* Intuition as long as there's a good correspondence between     *)
  162.     (* the image and the specified Gadgets                 *)
  163.  
  164.     ImageBMap    : BitMapPtr ;    (* points to the BitMap of PREDRAWN imagery *)
  165.     RWindow    : WindowPtr ;    (* added.  points back to Window        *)
  166.     ReqImage    : ImagePtr ;    (* new for V36: drawn if USEREQIMAGE set    *)
  167.     ReqPad2    : ARRAY [0..31] OF SHORTCARD ;
  168.   END ;
  169.  
  170. CONST
  171.   (* FLAGS SET BY THE APPLIPROG *)
  172.   POINTREL    = {0} ;(* if POINTREL set,TopLeft is relative to pointer      *)
  173.                (* for DMRequester,relative to window center forRequest*)
  174.  
  175.   PREDRAWN    = {1} ;(* set if Requester.ImageBMap points to predrawn       *)
  176.                  (* Requester imagery                   *)
  177.  
  178.   NOISYREQ    = {2} ; (* if you don't want requester to filter input       *)
  179.   SIMPLEREQ    = {4} ; (* to use SIMPLEREFRESH layer (recommended)       *)
  180.  
  181.   (* New for V36 *)
  182.  
  183.   USEREQIMAGE    = {5} ; (*  render linked list ReqImage after BackFill       *)
  184.                 (* but before gadgets and text               *)
  185.  
  186.   NOREQBACKFILL = {6} ; (* don't bother filling requester with           *)
  187.                   (* Requester.BackFill pen               *)
  188.  
  189.   (* FLAGS SET BY INTUITION *)
  190.  
  191.   REQOFFWINDOW    = {12} ;    (* part of one of the Gadgets was offwindow *)
  192.   REQACTIVE    = {13} ;    (* this requester is active            *)
  193.   SYSREQUEST    = {14} ;    (* (unused) this requester caused by system *)
  194.   DEFERREFRESH    = {15} ;    (* this Requester stops a Refresh broadcast *)
  195.  
  196. (* ========================================================================== *)
  197. (* === Gadget =============================================================== *)
  198. (* ========================================================================== *)
  199.  
  200. TYPE
  201.   Gadget = RECORD
  202.     NextGadget    : GadgetPtr ;    (* next gadget in the list     *)
  203.     LeftEdge    : INTEGER ;
  204.     TopEdge    : INTEGER ;    (* "hit box" of gadget         *)
  205.     Width    : INTEGER ;
  206.     Height    : INTEGER ;    (* "hit box" of gadget         *)
  207.     Flags    : BITSET  ;    (* see below for list of defines *)
  208.     Activation  : BITSET  ;    (* see below for list of defines *)
  209.     GadgetType  : CARDINAL ;    (* see below for defines     *)
  210.  
  211.     (* appliprog can specify that the Gadget be rendered as either as Border  *)
  212.     (* or an Image.  This variable points to which (or equals NULL if there's *)
  213.     (* nothing to be rendered about this Gadget)                  *)
  214.  
  215.     GadgetRender : ADDRESS ;
  216.  
  217.     (* appliprog can specify "highlighted" imagery rather than algorithmic    *)
  218.     (* this can point to either Border or Image data                  *)
  219.  
  220.     SelectRender : ADDRESS ;
  221.     GadgetText     : IntuiTextPtr ;   (* text for this gadget *)
  222.  
  223.     (* MutualExclude, never implemented, is now declared obsolete.    *)
  224.     (* There are published examples of implementing a more general    *)
  225.     (* and practical exclusion in your applications.            *)
  226.     (*                                    *)
  227.     (* Starting with V36, this field is used to point to a hook        *)
  228.     (* for a custom gadget.                        *)
  229.     (*                                    *)
  230.     (* Programs using this field for their own processing will        *)
  231.     (* continue to work, as long as they don't try the            *)
  232.     (* trick with custom gadgets.                    *)
  233.  
  234.     MutualExclude : LONGSET ;  (* obsolete *)
  235.  
  236.     (* pointer to a structure of special data required by Proportional, *)
  237.     (* String and Integer Gadgets                    *)
  238.  
  239.     SpecialInfo : ADDRESS ;
  240.  
  241.     GadgetID : CARDINAL ; (* user-definable ID field                  *)
  242.     UserData : ADDRESS  ; (* ptr to general purpose User data (ignored by In) *)
  243.   END ;
  244.  
  245.   ExtGadget = RECORD
  246.     (* The first fields match struct Gadget exactly *)
  247.     NextGadget      : GadgetPtr ;        (* Matches struct Gadget *)
  248.     LeftEdge      : INTEGER ;        (* Matches struct Gadget *)
  249.     TopEdge      : INTEGER ;        (* Matches struct Gadget *)
  250.     Width      : INTEGER ;        (* Matches struct Gadget *)
  251.     Height      : INTEGER ;        (* Matches struct Gadget *)
  252.     Flags      : BITSET  ;        (* Matches struct Gadget *)
  253.     Activation    : BITSET  ;        (* Matches struct Gadget *)
  254.     GadgetType      : CARDINAL;        (* Matches struct Gadget *)
  255.     GadgetRender  : ADDRESS ;        (* Matches struct Gadget *)
  256.     SelectRender  : ADDRESS ;        (* Matches struct Gadget *)
  257.     GadgetText      : IntuiTextPtr ;    (* Matches struct Gadget *)
  258.     MutualExclude : LONGSET  ;        (* Matches struct Gadget *)
  259.     SpecialInfo      : ADDRESS  ;        (* Matches struct Gadget *)
  260.     GadgetID      : CARDINAL ;        (* Matches struct Gadget *)
  261.     UserData      : ADDRESS  ;        (* Matches struct Gadget *)
  262.  
  263.     (* These fields only exist under V39 and only if GFLG_EXTENDED is set *)
  264.     MoreFlags      : LONGSET ;    (* see GMORE_ flags below        *)
  265.     BoundsLeftEdge: INTEGER ;    (* Bounding extent for gadget, valid    *)
  266.     BoundsTopEdge : INTEGER ;    (* only if GMORE_BOUNDS is set.  The    *)
  267.     BoundsWidth      : INTEGER ;    (* GFLG_RELxxx flags affect these     *)
  268.     BoundsHeight  : INTEGER ;    (* coordinates as well.            *)
  269.   END ;
  270.  
  271. (* --- Gadget.Flags values    --- *)
  272. (* combinations in these bits describe the highlight technique to be used *)
  273. CONST
  274.   GFLG_GADGHIGHBITS = {0,1} ;
  275.   GFLG_GADGHCOMP  = { } ;    (* Complement the select box        *)
  276.   GFLG_GADGHBOX      = {0} ;    (* Draw a box around the image        *)
  277.   GFLG_GADGHIMAGE = {1} ;    (* Blast in this alternate image    *)
  278.   GFLG_GADGHNONE  = {0,1};    (* don't highlight            *)
  279.  
  280.   GFLG_GADGIMAGE  = {2} ;    (* set if GadgetRender and SelectRender    *)
  281.                 (* point to an Image structure, clear    *)
  282.                 (* if they point to Border structures    *)
  283.  
  284. (* combinations in these next two bits specify to which corner the gadget's  *)
  285. (*  Left & Top coordinates are relative.  If relative to Top/Left,         *)
  286. (*  these are "normal" coordinates (everything is relative to something in   *)
  287. (*  this universe).                                 *)
  288. (*                                         *)
  289. (* Gadget positions and dimensions are relative to the window or         *)
  290. (* requester which contains the gadget                         *)
  291.  
  292.   GFLG_RELBOTTOM  = {3} ; (* vert. pos. is relative to bottom edge *)
  293.   GFLG_RELRIGHT      = {4} ; (* horiz. pos. is relative to right edge *)
  294.   GFLG_RELWIDTH      = {5} ; (* width is relative to req/window       *)
  295.   GFLG_RELHEIGHT  = {6} ; (* height is relative to req/window       *)
  296.  
  297. (* New for V39: GFLG_RELSPECIAL allows custom gadget implementors to    *)
  298. (* make gadgets whose position and size depend in an arbitrary way    *)
  299. (* on their window's dimensions.  The GM_LAYOUT method will be invoked    *)
  300. (* for such a gadget (or any other GREL_xxx gadget) at suitable times,    *)
  301. (* such as when the window opens or the window's size changes.        *)
  302.  
  303.   GFLG_RELSPECIAL = {14} ;  (* custom gadget has special relativity.    *)
  304.                 (* Gadget box values are absolutes, but    *)
  305.                 (* can be changed via the GM_LAYOUT method.    *)
  306.  
  307.   GFLG_SELECTED      = {7} ;   (* you may initialize and look at this    *)
  308.  
  309. (* the GFLG_DISABLED flag is initialized by you and later set by Intuition *)
  310. (* according to your calls to On/OffGadget().  It specifies whether or not *)
  311. (* this Gadget is currently disabled from being selected           *)
  312.  
  313.   GFLG_DISABLED      = {8} ;
  314.  
  315. (* These flags specify the type of text field that Gadget.GadgetText    *)
  316. (* points to.  In all normal (pre-V36) gadgets which you initialize    *)
  317. (* this field should always be zero.  Some types of gadget objects    *)
  318. (* created from classes will use these fields to keep track of        *)
  319. (* types of labels/contents that different from IntuiText, but are    *)
  320. (* stashed in GadgetText.                        *)
  321.  
  322.   GFLG_LABELMASK    = {12,13} ;
  323.   GFLG_LABELITEXT   = { }  ; (* GadgetText points to IntuiText        *)
  324.   GFLG_LABELSTRING  = {12} ; (* GadgetText points to ( UBYTE * )    *)
  325.   GFLG_LABELIMAGE   = {13} ; (* GadgetText points to Image (object) *)
  326.  
  327. (* New for V37: GFLG_TABCYCLE *)
  328.   GFLG_TABCYCLE        = {9} ; (* (string or custom) gadget participates in *)
  329.                 (* cycling activation with Tab or Shift-Tab     *)
  330.  
  331. (* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly  *)
  332. (* ignore the value we had chosen for the Gadget->Activation flag         *)
  333. (* GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.         *)
  334. (* The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is *)
  335. (* safe under V34, and equivalent to GACT_STRINGEXTEND under V37.         *)
  336. (* (Note that the two flags are not numerically equal)                 *)
  337.  
  338.   GFLG_STRINGEXTEND = {10} ;   (* this String Gadget has StringExtend *)
  339.  
  340. (* New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if    *)
  341. (* the custom image of this gadget knows how to do disabled rendering    *)
  342. (* (more specifically, if its IA_SupportsDisable attribute is TRUE).    *)
  343. (* Intuition uses this to defer the ghosting to the image-class,    *)
  344. (* instead of doing it itself (the old compatible way).            *)
  345. (* Do not set this flag yourself - Intuition will do it for you.    *)
  346.  
  347.   GFLG_IMAGEDISABLE = {11} ;
  348.               (* Gadget's image knows how to do disabled rendering *)
  349.  
  350. (* New for V39:  If set, this bit means that the Gadget is actually    *)
  351. (* a struct ExtGadget, with new fields and flags.  All V39 boopsi    *)
  352. (* gadgets are ExtGadgets.  Never ever attempt to read the extended    *)
  353. (* fields of a gadget if this flag is not set.                *)
  354.  
  355.   GFLG_EXTENDED        = {15} ;  (* Gadget is extended *)
  356.  
  357. (* ---    Gadget.Activation flag values    --- *)
  358. (* Set GACT_RELVERIFY if you want to verify that the pointer was still over *)
  359. (* the gadget when the select button was released.  Will cause            *)
  360. (* an IDCMP_GADGETUP message to be sent if so.                    *)
  361.  
  362.   GACT_RELVERIFY    = {0} ;
  363.  
  364. (* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget      *)
  365. (*  was activated when it was activated.  This flag works in conjunction with *)
  366. (*  the GACT_RELVERIFY flag                              *)
  367.  
  368.   GACT_IMMEDIATE    = {1} ;
  369.  
  370. (* the flag GACT_ENDGADGET, when set, tells the system that this gadget, *)
  371. (* when selected, causes the Requester to be ended.  Requesters         *)
  372. (* that are ended are erased and unlinked from the system.         *)
  373.  
  374.   GACT_ENDGADGET    = {2} ;
  375.  
  376. (* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive   *)
  377. (* reports on mouse movements while this gadget is active.             *)
  378. (* You probably want to set the GACT_IMMEDIATE flag when using             *)
  379. (* GACT_FOLLOWMOUSE, since that's the only reasonable way you have of         *)
  380. (* learning why Intuition is suddenly sending you a stream of mouse         *)
  381. (* movement events.  If you don't set GACT_RELVERIFY, you'll get at         *)
  382. (* least one Mouse Position event.                         *)
  383. (* Note: boolean FOLLOWMOUSE gadgets require GACT_RELVERIFY to get         *)
  384. (* _any_ mouse movement events (this unusual behavior is a compatibility     *)
  385. (* hold-over from the old days).                         *)
  386.  
  387.   GACT_FOLLOWMOUSE  = {3} ;
  388.  
  389. (* if any of the BORDER flags are set in a Gadget that's included in the  *)
  390. (* Gadget list when a Window is opened, the corresponding Border will     *)
  391. (* be adjusted to make room for the Gadget                  *)
  392.  
  393.   GACT_RIGHTBORDER  = {4} ;
  394.   GACT_LEFTBORDER   = {5} ;
  395.   GACT_TOPBORDER    = {6} ;
  396.   GACT_BOTTOMBORDER = {7} ;
  397.   GACT_BORDERSNIFF  = {15};  (* neither set nor rely on this bit    *)
  398.  
  399.   GACT_TOGGLESELECT = {8}  ; (* this bit for toggle-select mode *)
  400.   GACT_BOOLEXTEND   = {13} ; (* this Boolean Gadget has a BoolInfo    *)
  401.  
  402. (* should properly be in StringInfo, but aren't    *)
  403.   GACT_STRINGLEFT   =  { } ; (* NOTE WELL: that this has value zero    *)
  404.   GACT_STRINGCENTER =  {9} ;
  405.   GACT_STRINGRIGHT  = {10} ;
  406.   GACT_LONGINT        = {11} ; (* this String Gadget is for Long Ints     *)
  407.   GACT_ALTKEYMAP    = {12} ; (* this String has an alternate keymap     *)
  408.   GACT_STRINGEXTEND = {13} ; (* this String Gadget has StringExtend     *)
  409.                  (* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU *)
  410.                  (* ARE RUNNING ON LESS THAN V36!  SEE       *)
  411.                  (* GFLG_STRINGEXTEND (ABOVE) INSTEAD        *)
  412.  
  413.   GACT_ACTIVEGADGET = {14} ;(* this gadget is "active".  This flag    *)
  414.                 (* is maintained by Intuition, and you    *)
  415.                 (* cannot count on its value persisting    *)
  416.                 (* while you do something on your program's    *)
  417.                 (* task.  It can only be trusted by        *)
  418.                 (* people implementing custom gadgets    *)
  419.  
  420. (* note 0x8000 is used above (GACT_BORDERSNIFF);    *)
  421. (* all Activation flags defined                *)
  422.  
  423. (* --- GADGET TYPES --------------------------------------------------- *)
  424. (* These are the Gadget Type definitions for the variable GadgetType    *)
  425. (* gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.    *)
  426. (* first comes the mask for Gadget flags reserved for Gadget typing    *)
  427.  
  428.   GTYP_GADGETTYPE    = 0FC00H ; (* all Gadget Global Type flags (padded) *)
  429.  
  430.   GTYP_SCRGADGET    = 04000H ; (* 1 = ScreenGadget, 0 = WindowGadget    *)
  431.   GTYP_GZZGADGET    = 02000H ; (* 1 = for WFLG_GIMMEZEROZERO borders    *)
  432.   GTYP_REQGADGET    = 01000H ; (* 1 = this is a Requester Gadget        *)
  433.  
  434. (* GTYP_SYSGADGET means that Intuition ALLOCATED the gadget.        *)
  435. (* GTYP_SYSTYPEMASK is the mask you can apply to tell what type of    *)
  436. (* system-gadget it is.  The possible types follow.            *)
  437.  
  438.   GTYP_SYSGADGET    = 08000H ;
  439.   GTYP_SYSTYPEMASK    = 000F0H ;
  440.  
  441. (* These definitions describe system gadgets in V36 and higher: *)
  442.   GTYP_SIZING        = 00010H ; (* Window sizing gadget    *)
  443.   GTYP_WDRAGGING    = 00020H ; (* Window drag bar        *)
  444.   GTYP_SDRAGGING    = 00030H ; (* Screen drag bar        *)
  445.   GTYP_WDEPTH        = 00040H ; (* Window depth gadget    *)
  446.   GTYP_SDEPTH        = 00050H ; (* Screen depth gadget    *)
  447.   GTYP_WZOOM        = 00060H ; (* Window zoom gadget    *)
  448.   GTYP_SUNUSED        = 00070H ; (* Unused screen gadget    *)
  449.   GTYP_CLOSE        = 00080H ; (* Window close gadget    *)
  450.  
  451. (* These definitions describe system gadgets prior to V36: *)
  452.   GTYP_WUPFRONT        = GTYP_WDEPTH  ; (* Window to-front gadget *)
  453.   GTYP_SUPFRONT        = GTYP_SDEPTH  ; (* Screen to-front gadget *)
  454.   GTYP_WDOWNBACK    = GTYP_WZOOM   ; (* Window to-back gadget  *)
  455.   GTYP_SDOWNBACK    = GTYP_SUNUSED ; (* Screen to-back gadget  *)
  456.  
  457. (* GTYP_GTYPEMASK is a mask you can apply to tell what class    *)
  458. (* of gadget this is.  The possible classes follow.        *)
  459.  
  460.   GTYP_GTYPEMASK    = 00007H ;
  461.  
  462.   GTYP_BOOLGADGET    = 00001H ;
  463.   GTYP_GADGET0002    = 00002H ;
  464.   GTYP_PROPGADGET    = 00003H ;
  465.   GTYP_STRGADGET    = 00004H ;
  466.   GTYP_CUSTOMGADGET    = 00005H ;
  467.  
  468. (* This bit in GadgetType is reserved for undocumented internal use    *)
  469. (* by the Gadget Toolkit, and cannot be used nor relied on by        *)
  470. (* applications:    00100H                        *)
  471.  
  472. (* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are    *)
  473. (* actually ExtGadgets, which have more flags.    The GMORE_xxx        *)
  474. (* identifiers describe those flags.  For GMORE_SCROLLRASTER, see    *)
  475. (* important information in the ScrollWindowRaster() autodoc.        *)
  476. (* NB: GMORE_SCROLLRASTER must be set before the gadget is        *)
  477. (* added to a window.                            *)
  478.  
  479.   GMORE_BOUNDS        = {0} ; (* ExtGadget has valid Bounds          *)
  480.   GMORE_GADGETHELP    = {1} ; (* This gadget responds to gadget help      *)
  481.   GMORE_SCROLLRASTER    = {2} ; (* This (custom) gadget uses ScrollRaster *)
  482.  
  483. (* ========================================================================== *)
  484. (* === BoolInfo============================================================== *)
  485. (* ========================================================================== *)
  486. (* This is the special data needed by an Extended Boolean Gadget          *)
  487. (* Typically this structure will be pointed to by the Gadget field SpecialInfo*)
  488.  
  489. TYPE
  490.   BoolInfo = RECORD
  491.     Flags : BITSET  ;    (* defined below *)
  492.     Mask  : ADDRESS ;    (* bit mask for highlighting and selecting'    *)
  493.             (* mask must follow the same rules as an Image    *)
  494.             (* plane.  Its width and height are determined    *)
  495.             (* by the width and height of the gadget's    *)
  496.             (* select box. (i.e. Gadget.Width and .Height).    *)
  497.  
  498.     Reserved : LONGINT ;(* set to 0 *)
  499.   END ;
  500.  
  501. (* set BoolInfo.Flags to this flag bit.                    *)
  502. (* in the future, additional bits might mean more stuff hanging        *)
  503. (* off of BoolInfo.Reserved.                        *)
  504.  
  505. CONST
  506.   BOOLMASK = {0} ; (* extension is for masked gadget *)
  507.  
  508. (* ========================================================================== *)
  509. (* === PropInfo ============================================================= *)
  510. (* ========================================================================== *)
  511. (* this is the special data required by the proportional Gadget              *)
  512. (* typically, this data will be pointed to by the Gadget variable SpecialInfo *)
  513.  
  514. TYPE
  515.   PropInfo = RECORD
  516.     Flags : BITSET ; (* general purpose flag bits (see defines below) *)
  517.  
  518.     (* You initialize the Pot variables before the Gadget is added to    *)
  519.     (* the system.  Then you can look here for the current settings    *)
  520.     (* any time, even while User is playing with this Gadget.  To    *)
  521.     (* adjust these after the Gadget is added to the System, use    *)
  522.     (* ModifyProp();  The Pots are the actual proportional settings,    *)
  523.     (* where a value of zero means zero and a value of MAXPOT means    *)
  524.     (* that the Gadget is set to its maximum setting.            *)
  525.  
  526.     HorizPot : CARDINAL ; (* 16-bit FixedPoint horizontal quantity percentage *)
  527.     VertPot  : CARDINAL ; (* 16-bit FixedPoint vertical quantity percentage   *)
  528.  
  529.     (* the 16-bit FixedPoint Body variables describe what percentage of    *)
  530.     (* the entire body of stuff referred to by this Gadget is actually       *)
  531.     (* shown at one time.  This is used with the AUTOKNOB routines,       *)
  532.     (* to adjust the size of the AUTOKNOB according to how much of       *)
  533.     (* the data can be seen.  This is also used to decide how far       *)
  534.     (* to advance the Pots when User hits the Container of the Gadget.       *)
  535.     (* For instance, if you were controlling the display of a 5-line       *)
  536.     (* Window of text with this Gadget, and there was a total of 15       *)
  537.     (* lines that could be displayed, you would set the VertBody value to  *)
  538.     (*       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.       *)
  539.     (* Therefore, the AUTOKNOB would fill 1/3 of the container, and       *)
  540.     (* if User hits the Cotainer outside of the knob, the pot would       *)
  541.     (* advance 1/3 (plus or minus) If there's no body to show, or       *)
  542.     (* the total amount of displayable info is less than the display area, *)
  543.     (* set the Body variables to the MAX.  To adjust these after the       *)
  544.     (* Gadget is added to the System, use ModifyProp();               *)
  545.  
  546.     HorizBody : CARDINAL ; (* horizontal Body    *)
  547.     VertBody  : CARDINAL ; (* vertical Body    *)
  548.  
  549.     (* these are the variables that Intuition sets and maintains *)
  550.     CWidth  : CARDINAL ; (* Container width (with any relativity absoluted)  *)
  551.     CHeight : CARDINAL ; (* Container height (with any relativity absoluted) *)
  552.     HPotRes : CARDINAL ;
  553.     VPotRes : CARDINAL ; (* pot increments *)
  554.     LeftBorder : CARDINAL ; (* Container borders *)
  555.     TopBorder  : CARDINAL ; (* Container borders *)
  556.   END ;
  557.  
  558. (* --- FLAG BITS ---------------------------------------------------------- *)
  559.  
  560. CONST
  561.   AUTOKNOB    = {0} ;    (* this flag sez:  gimme that old auto-knob *)
  562.  
  563. (* NOTE: if you do not use an AUTOKNOB for a proportional gadget,    *)
  564. (* you are currently limited to using a single Image of your own    *)
  565. (* design: Intuition won't handle a linked list of images as        *)
  566. (* a proportional gadget knob.                        *)
  567.  
  568.   FREEHORIZ    = {1} ;    (* if set, the knob can move horizontally    *)
  569.   FREEVERT    = {2} ;    (* if set, the knob can move vertically        *)
  570.   PROPBORDERLESS= {3} ;    (* if set, no border will be rendered        *)
  571.   KNOBHIT    = {8} ;    (* set when this Knob is hit            *)
  572.   PROPNEWLOOK    = {4} ;    (* set this if you want to get the new V36 look *)
  573.  
  574.   KNOBHMIN    = 6 ;    (* minimum horizontal size of the Knob    *)
  575.   KNOBVMIN    = 4 ;    (* minimum vertical size of the Knob    *)
  576.   MAXBODY    = 0FFFFH ; (* maximum body value *)
  577.   MAXPOT    = 0FFFFH ; (* maximum pot value  *)
  578.  
  579. (* ========================================================================== *)
  580. (* === StringInfo =========================================================== *)
  581. (* ========================================================================== *)
  582. (* this is the special data required by the string Gadget              *)
  583. (* typically, this data will be pointed to by the Gadget variable SpecialInfo *)
  584.  
  585. TYPE
  586.   StringInfo = RECORD
  587.     (* you initialize these variables, and then Intuition maintains them *)
  588.     Buffer    : STRING  ; (* the buffer containing the start & final string *)
  589.     UndoBuffer    : STRING  ; (* optional buffer for undoing current entry      *)
  590.     BufferPos    : INTEGER ; (* character position in Buffer              *)
  591.     MaxChars    : INTEGER ; (* max number of chars in Buffer (including NULL) *)
  592.     DispPos    : INTEGER ; (* Buffer position of first displayed character   *)
  593.  
  594.     (* Intuition initializes and maintains these variables for you *)
  595.     UndoPos    : INTEGER ; (* character position in the undo buffer          *)
  596.     NumChars    : INTEGER ; (* number of characters currently in Buffer          *)
  597.     DispCount    : INTEGER ; (* number of whole characters visible in Container*)
  598.     CLeft, CTop : INTEGER ; (* topleft offset of the container              *)
  599.  
  600.     (* This unused field is changed to allow extended specification    *)
  601.     (* of string gadget parameters.  It is ignored unless the flag    *)
  602.     (* GACT_STRINGEXTEND is set in the Gadget's Activation field    *)
  603.     (* or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.    *)
  604.     (* (See GFLG_STRINGEXTEND for an important note)            *)
  605.  
  606.     (* struct Layer *LayerPtr;    --- obsolete --- *)
  607.  
  608.     Extension    : StringExtendPtr ;
  609.  
  610.     (* you can initialize this variable before the gadget is submitted to *)
  611.     (* Intuition, and then examine it later to discover what integer      *)
  612.     (* the user has entered (if the user never plays with the gadget,      *)
  613.     (* the value will be unchanged from your initial setting)          *)
  614.  
  615.     LongInt    : LONGINT ;
  616.  
  617.     (* If you want this Gadget to use your own Console keymapping, you    *)
  618.     (* set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,  *)
  619.     (* and then set this variable to point to your keymap.  If you don't  *)
  620.     (* set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.  *)
  621.  
  622.     AltKeyMap    : KeyMapPtr ;
  623.   END ;
  624.  
  625. (* ========================================================================== *)
  626. (* === IntuiText ============================================================ *)
  627. (* ========================================================================== *)
  628. (* IntuiText is a series of strings that start with a location              *)
  629. (*  (always relative to the upper-left corner of something) and then the      *)
  630. (*  text of the string.  The text is null-terminated.                  *)
  631.  
  632. TYPE
  633.   IntuiText = RECORD
  634.     FrontPen : SHORTCARD ;
  635.     BackPen  : SHORTCARD ;    (* the pen numbers for the rendering    *)
  636.     DrawMode : SHORTSET     ;    (* the mode for rendering the text    *)
  637.     LeftEdge : INTEGER     ;    (* relative start location for the text    *)
  638.     TopEdge  : INTEGER     ;    (* relative start location for the text    *)
  639.     ITextFont: TextAttrPtr ;  (* if NULL, you accept the default    *)
  640.     IText    : STRING     ;    (* pointer to null-terminated text    *)
  641.     NextText : IntuiTextPtr ; (* pointer to another IntuiText to render *)
  642.   END ;
  643.  
  644. (* ========================================================================== *)
  645. (* === Border =============================================================== *)
  646. (* ========================================================================== *)
  647. (* Data type Border, used for drawing a series of lines which is intended for *)
  648. (*  use as a border drawing, but which may, in fact, be used to render any    *)
  649. (*  arbitrary vector shape.                              *)
  650. (*  The routine DrawBorder sets up the RastPort with the appropriate          *)
  651. (*  variables, then does a Move to the first coordinate, then does Draws      *)
  652. (*  to the subsequent coordinates.                          *)
  653. (*  After all the Draws are done,if NextBorder is non-zero we call DrawBorder *)
  654. (*  on NextBorder                                  *)
  655.  
  656. TYPE
  657.   Border = RECORD
  658.     LeftEdge  : INTEGER   ;
  659.     TopEdge   : INTEGER   ; (* initial offsets from the origin        *)
  660.     FrontPen  : SHORTCARD ;
  661.     BackPen   : SHORTCARD ; (* pens numbers for rendering        *)
  662.     DrawMode  : SHORTSET  ; (* mode for rendering            *)
  663.     Count     : SHORTINT  ; (* number of XY pairs            *)
  664.     XY          : ADDRESS   ; (* vector coordinate pairs rel to LeftTop    *)
  665.     NextBorder: BorderPtr ; (* pointer to any other Border too        *)
  666.   END ;
  667.  
  668. (* ========================================================================== *)
  669. (* === Image ================================================================ *)
  670. (* ========================================================================== *)
  671. (* This is a brief image structure for very simple transfers of              *)
  672. (* image data to a RastPort                              *)
  673.  
  674. TYPE
  675.   Image = RECORD
  676.     LeftEdge  : INTEGER ; (* starting offset relative to some origin  *)
  677.     TopEdge   : INTEGER ; (* starting offsets relative to some origin *)
  678.     Width     : INTEGER ; (* pixel size (though data is word-aligned) *)
  679.     Height    : INTEGER ;
  680.     Depth     : INTEGER ; (* >= 0, for images you create          *)
  681.     ImageData : ADDRESS ; (* pointer to the actual word-aligned bits  *)
  682.  
  683.     (* the PlanePick and PlaneOnOff variables work much the same way as *)
  684.     (* the equivalent GELS Bob variables.  It's a space-saving        *)
  685.     (* mechanism for image data.  Rather than defining the image data   *)
  686.     (* for every plane of the RastPort, you need define data only    *)
  687.     (* for the planes that are not entirely zero or one.  As you    *)
  688.     (* define your Imagery, you will often find that most of the planes    *)
  689.     (* ARE just as color selectors.  For instance, if you're designing    *)
  690.     (* a two-color Gadget to use colors one and three, and the Gadget    *)
  691.     (* will reside in a five-plane display, bit plane zero of your    *)
  692.     (* imagery would be all ones, bit plane one would have data that    *)
  693.     (* describes the imagery, and bit planes two through four would be    *)
  694.     (* all zeroes.  Using these flags avoids wasting all        *)
  695.     (* that memory in this way:  first, you specify which planes you    *)
  696.     (* want your data to appear in using the PlanePick variable.  For    *)
  697.     (* each bit set in the variable, the next "plane" of your image    *)
  698.     (* data is blitted to the display.    For each bit clear in this    *)
  699.     (* variable, the corresponding bit in PlaneOnOff is examined.    *)
  700.     (* If that bit is clear, a "plane" of zeroes will be used.        *)
  701.     (* If the bit is set, ones will go out instead. So, for our example:*)
  702.     (*     Gadget.PlanePick = 0x02;                    *)
  703.     (*     Gadget.PlaneOnOff = 0x01;                    *)
  704.     (* Note that this also allows for generic Gadgets, like the        *)
  705.     (* System Gadgets, which will work in any number of bit planes.    *)
  706.     (* Note also that if you want an Image that is only a filled    *)
  707.     (* rectangle, you can get this by setting PlanePick to zero        *)
  708.     (* (pick no planes of data) and set PlaneOnOff to describe the pen    *)
  709.     (* color of the rectangle.                        *)
  710.     (*                                    *)
  711.     (* NOTE:  Intuition relies on PlanePick to know how many planes    *)
  712.     (* of data are found in ImageData.    There should be no more        *)
  713.     (* '1'-bits in PlanePick than there are planes in ImageData.    *)
  714.  
  715.     PlanePick, PlaneOnOff : SHORTCARD ;
  716.  
  717.     (* if the NextImage variable is not NULL, Intuition presumes that    *)
  718.     (* it points to another Image structure with another Image to be    *)
  719.     (* rendered                                *)
  720.  
  721.     NextImage : ImagePtr ;
  722.   END ;
  723.  
  724. (* ======================================================================== *)
  725. (* === IntuiMessage ======================================================= *)
  726. (* ======================================================================== *)
  727.  
  728. TYPE
  729.   IntuiMessage = RECORD
  730.     ExecMessage    : Message ;
  731.  
  732.     (* the Class bits correspond directly with the IDCMP Flags,except for the *)
  733.     (* special bit IDCMP_LONELYMESSAGE (defined below)                  *)
  734.  
  735.     Class    : LONGSET ;
  736.  
  737.     (* the Code field is for special values like MENU number *)
  738.     Code : CARDINAL ;
  739.  
  740.     (* the Qualifier field is a copy of the current InputEvent's Qualifier *)
  741.     Qualifier    : CARDINAL ;
  742.  
  743.     (* IAddress contains particular addresses for Intuition functions, like *)
  744.     (* the pointer to the Gadget or the Screen                    *)
  745.  
  746.     IAddress    : ADDRESS ;
  747.  
  748.     (* when getting mouse movement reports, any event you get will have the   *)
  749.     (* the mouse coordinates in these variables.  the coordinates are relative*)
  750.     (* to the upper-left corner of your Window (WFLG_GIMMEZEROZERO          *)
  751.     (* notwithstanding).  If IDCMP_DELTAMOVE is set, these values will          *)
  752.     (* be deltas from the last reported position.                  *)
  753.  
  754.     MouseX    : INTEGER ;
  755.     MouseY    : INTEGER ;
  756.  
  757.     (* the time values are copies of the current system clock time.  Micros   *)
  758.     (* are in units of microseconds, Seconds in seconds.              *)
  759.  
  760.     Seconds    : LONGINT ;
  761.     Micros    : LONGINT ;
  762.  
  763.     (* the IDCMPWindow variable will always have the address of the Window of *)
  764.     (* this IDCMP                                  *)
  765.  
  766.     IDCMPWindow : WindowPtr ;
  767.  
  768.     (* system-use variable *)
  769.     SpecialLink : IntuiMessagePtr ;
  770.  
  771.   END ;
  772.  
  773. (* New for V39:                                  *)
  774. (* All IntuiMessages are now slightly extended.  The ExtIntuiMessage      *)
  775. (* structure has an additional field for tablet data, which is usually      *)
  776. (* NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET      *)
  777. (* events is installed in the system, windows with the WA_TabletMessages  *)
  778. (* property set will find that eim_TabletData points to the TabletData      *)
  779. (* structure.  Applications must first check that this field is non-NULL; *)
  780. (* it will be NULL for certain kinds of message, including mouse activity *)
  781. (* generated from other than the tablet (i.e. the keyboard equivalents      *)
  782. (* or the mouse itself).                          *)
  783. (*                                      *)
  784. (* NEVER EVER examine any extended fields when running under pre-V39!      *)
  785. (*                                      *)
  786. (* NOTE: This structure is subject to grow in the future.  Making      *)
  787. (* assumptions about its size is A BAD IDEA.                  *)
  788.  
  789.   ExtIntuiMessage = RECORD
  790.      eim_IntuiMessage    : IntuiMessage  ;
  791.      eim_TabletData    : TabletDataPtr ;
  792.   END ;
  793.  
  794. (* --- IDCMP Classes -------------------------------------------------------- *)
  795. (* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel          *)
  796. (* Manual for full details on the IDCMP classes.                  *)
  797.  
  798. CONST
  799.   IDCMP_SIZEVERIFY    = {0} ;
  800.   IDCMP_NEWSIZE        = {1} ;
  801.   IDCMP_REFRESHWINDOW    = {2} ;
  802.   IDCMP_MOUSEBUTTONS    = {3} ;
  803.   IDCMP_MOUSEMOVE    = {4} ;
  804.   IDCMP_GADGETDOWN    = {5} ;
  805.   IDCMP_GADGETUP    = {6} ;
  806.   IDCMP_REQSET        = {7} ;
  807.   IDCMP_MENUPICK    = {8} ;
  808.   IDCMP_CLOSEWINDOW    = {9} ;
  809.   IDCMP_RAWKEY        = {10} ;
  810.   IDCMP_REQVERIFY    = {11} ;
  811.   IDCMP_REQCLEAR    = {12} ;
  812.   IDCMP_MENUVERIFY    = {13} ;
  813.   IDCMP_NEWPREFS    = {14} ;
  814.   IDCMP_DISKINSERTED    = {15} ;
  815.   IDCMP_DISKREMOVED    = {16} ;
  816.   IDCMP_WBENCHMESSAGE    = {17} ;  (* System use only *)
  817.   IDCMP_ACTIVEWINDOW    = {18} ;
  818.   IDCMP_INACTIVEWINDOW    = {19} ;
  819.   IDCMP_DELTAMOVE    = {20} ;
  820.   IDCMP_VANILLAKEY    = {21} ;
  821.   IDCMP_INTUITICKS    = {22} ;
  822.  
  823.   (*  for notifications from "boopsi" gadgets    *)
  824.   IDCMP_IDCMPUPDATE    = {23} ; (* new for V36    *)
  825.  
  826.   (* for getting help key report during menu session      *)
  827.   IDCMP_MENUHELP    = {24} ; (* new for V36    *)
  828.  
  829.   (* for notification of any move/size/zoom/change window *)
  830.   IDCMP_CHANGEWINDOW    = {25} ; (* new for V36    *)
  831.   IDCMP_GADGETHELP    = {26} ; (* new for V39    *)
  832.  
  833. (* NOTEZ-BIEN:    0x80000000 is reserved for internal use   *)
  834.  
  835. (* the IDCMP Flags do not use this special bit, which is cleared when       *)
  836. (* Intuition sends its special message to the Task, and set when Intuition *)
  837. (* gets its Message back from the Task.  Therefore, I can check here to       *)
  838. (* find out fast whether or not this Message is available for me to send   *)
  839.  
  840.   IDCMP_LONELYMESSAGE    = {31} ;
  841.  
  842. (* --- IDCMP Codes -------------------------------------------------------- *)
  843.  
  844. (* This group of codes is for the IDCMP_CHANGEWINDOW message *)
  845.   CWCODE_MOVESIZE = 00000H ; (* Window was moved and/or sized        *)
  846.   CWCODE_DEPTH    = 00001H ; (* Window was depth-arranged (new for V39) *)
  847.  
  848. (* This group of codes is for the IDCMP_MENUVERIFY message *)
  849.   MENUHOT    = 00001H ; (* IntuiWants verification or MENUCANCEL    *)
  850.   MENUCANCEL    = 00002H ; (* HOT Reply of this cancels Menu operation *)
  851.   MENUWAITING    = 00003H ; (* Intuition simply wants a ReplyMsg() ASAP *)
  852.  
  853. (* These are internal tokens to represent state of verification attempts *)
  854. (* shown here as a clue.                         *)
  855.  
  856.   OKOK        = MENUHOT    ; (* guy didn't care        *)
  857.   OKABORT    = 00004H     ; (* window rendered question moot    *)
  858.   OKCANCEL    = MENUCANCEL ; (* window sent cancel reply    *)
  859.  
  860. (* This group of codes is for the IDCMP_WBENCHMESSAGE messages *)
  861.   WBENCHOPEN    = 00001H ;
  862.   WBENCHCLOSE    = 00002H ;
  863.  
  864. (* A data structure common in V36 Intuition processing    *)
  865. TYPE
  866.   IBox = RECORD
  867.     Left, Top, Width, Height : INTEGER ;
  868.   END ;
  869.  
  870. (* ======================================================================== *)
  871. (* === Window ============================================================= *)
  872. (* ======================================================================== *)
  873.  
  874. TYPE
  875.   Window = RECORD
  876.     NextWindow    : WindowPtr ;    (* for the linked list in a screen    *)
  877.     LeftEdge    : INTEGER ;
  878.     TopEdge    : INTEGER ;    (* screen dimensions of window        *)
  879.     Width    : INTEGER ;
  880.     Height    : INTEGER ;    (* screen dimensions of window        *)
  881.     MouseY    : INTEGER ;
  882.     MouseX    : INTEGER ;    (* relative to upper-left of window    *)
  883.     MinWidth    : INTEGER ;
  884.     MinHeight    : INTEGER ;    (* minimum sizes            *)
  885.     MaxWidth    : INTEGER ;
  886.     MaxHeight    : INTEGER ;    (* maximum sizes            *)
  887.     Flags    : LONGSET ;    (* see below for defines        *)
  888.     MenuStrip    : MenuPtr ;    (* the strip of Menu headers        *)
  889.     Title    : STRING ;    (* the title text for this window    *)
  890.     FirstRequest: RequesterPtr ;(* all active Requesters        *)
  891.     DMRequest    : RequesterPtr ;(* double-click Requester        *)
  892.     ReqCount    : CARDINAL ;    (* count of reqs blocking Window    *)
  893.     WScreen    : ScreenPtr ;    (* this Window's Screen            *)
  894.     RPort    : RastPortPtr ;    (* this Window's very own RastPort    *)
  895.  
  896.     (* the border variables describe the window border.  If you specify       *)
  897.     (* WFLG_GIMMEZEROZERO when you open the window, then the upper-left of *)
  898.     (* the ClipRect for this window will be upper-left of the BitMap (with *)
  899.     (* correct offsets when in SuperBitMap mode; you MUST select       *)
  900.     (* WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify   *)
  901.     (* ZeroZero, then you save memory (no allocation of RastPort, Layer,   *)
  902.     (* ClipRect and associated Bitmaps), but you also must offset all your *)
  903.     (* writes by BorderTop, BorderLeft and do your own mini-clipping to       *)
  904.     (* prevent writing over the system gadgets                   *)
  905.  
  906.     BorderLeft    : SHORTINT ;
  907.     BorderTop    : SHORTINT ;
  908.     BorderRight : SHORTINT ;
  909.     BorderBottom: SHORTINT ;
  910.     BorderRPort    : RastPortPtr ;
  911.  
  912.     (* You supply a linked-list of Gadgets for your Window.        *)
  913.     (* This list DOES NOT include system gadgets.  You get the standard *)
  914.     (* window system gadgets by setting flag-bits in the variable Flags *)
  915.     (* (see the bit definitions below)                    *)
  916.  
  917.     FirstGadget    : GadgetPtr ;
  918.  
  919.     (* these are for opening/closing the windows *)
  920.     Parent    : WindowPtr ;
  921.     Descendant    : WindowPtr ;
  922.  
  923.     (* sprite data information for your own Pointer            *)
  924.     (* set these AFTER you Open the Window by calling SetPointer()    *)
  925.  
  926.     Pointer    : ADDRESS  ; (* sprite data                     *)
  927.     PtrHeight    : SHORTINT ; (* sprite height (not including sprite padding) *)
  928.     PtrWidth     : SHORTINT ; (* sprite width (must be <= 16)             *)
  929.  
  930.     XOffset    : SHORTINT ;
  931.     YOffset    : SHORTINT ; (* sprite offsets *)
  932.  
  933.     (* the IDCMP Flags and User's and Intuition's Message Ports *)
  934.  
  935.     IDCMPFlags    : LONGSET    ; (* User-selected flags *)
  936.     UserPort    : MsgPortPtr ;
  937.     WindowPort    : MsgPortPtr ;
  938.     MessageKey    : IntuiMessagePtr ;
  939.  
  940.     DetailPen    : SHORTCARD ;
  941.     BlockPen    : SHORTCARD ;    (* for bar/border/gadget rendering *)
  942.  
  943.     (* the CheckMark is a pointer to the imagery that will be used when    *)
  944.     (* rendering MenuItems of this Window that want to be checkmarked    *)
  945.     (* if this is equal to NULL, you'll get the default imagery        *)
  946.  
  947.     CheckMark    : ImagePtr ;
  948.     ScreenTitle : STRING ; (* if non-null, Screen title when Window is active *)
  949.  
  950.     (* These variables have the mouse coordinates relative to the          *)
  951.     (* inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the *)
  952.     (* MouseX and MouseY variables, which contain the mouse coordinates       *)
  953.     (* relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO    *)
  954.     (* notwithstanding                                  *)
  955.  
  956.     GZZMouseX    : INTEGER ;
  957.     GZZMouseY    : INTEGER ;
  958.  
  959.     (* these variables contain the width and height of the inner-Window of    *)
  960.     (* WFLG_GIMMEZEROZERO Windows                          *)
  961.  
  962.     GZZWidth    : INTEGER ;
  963.     GZZHeight    : INTEGER ;
  964.     ExtData    : ADDRESS ;
  965.     UserData    : ADDRESS ; (* general-purpose pointer to User data extension *)
  966.  
  967.     (* 11/18/85: this pointer keeps a duplicate of what    *)
  968.     (* Window.RPort->Layer is _supposed_ to be pointing at *)
  969.  
  970.     WLayer    : LayerPtr ;
  971.  
  972.     (* NEW 1.2: need to keep track of the font that        *)
  973.     (* OpenWindow opened, in case user SetFont's into RastPort  *)
  974.  
  975.     IFont    : TextFontPtr;
  976.  
  977.     (* (V36) another flag word (the Flags field is used up).        *)
  978.     (* At present, all flag values are system private.            *)
  979.     (* Until further notice, you may not change nor use this field.    *)
  980.  
  981.     MoreFlags    : LONGSET ;
  982.  
  983.     (**** Data beyond this point are Intuition Private.  DO NOT USE ****)
  984.   END ;
  985.  
  986. (* --- Flags requested at OpenWindow() time by the application --------- *)
  987. CONST
  988.   WFLG_SIZEGADGET    = {0} ; (* include sizing system-gadget?     *)
  989.   WFLG_DRAGBAR        = {1} ; (* include dragging system-gadget?   *)
  990.   WFLG_DEPTHGADGET    = {2} ; (* include depth arrangement gadget? *)
  991.   WFLG_CLOSEGADGET    = {3} ; (* include close-box system-gadget?  *)
  992.  
  993.   WFLG_SIZEBRIGHT    = {4} ; (* size gadget uses right border     *)
  994.   WFLG_SIZEBBOTTOM    = {5} ; (* size gadget uses bottom border    *)
  995.  
  996. (* --- refresh modes ------------------------------------------------------ *)
  997. (* combinations of the WFLG_REFRESHBITS select the refresh type            *)
  998.  
  999.   WFLG_REFRESHBITS    = {6,7} ;
  1000.   WFLG_SMART_REFRESH     =  { }  ;
  1001.   WFLG_SIMPLE_REFRESH    =  {6}  ;
  1002.   WFLG_SUPER_BITMAP      =  {7}  ;
  1003.   WFLG_OTHER_REFRESH     = {6,7} ;
  1004.  
  1005.   WFLG_BACKDROP        = {08} ; (* this is a backdrop window        *)
  1006.   WFLG_REPORTMOUSE    = {09} ; (* to hear about every mouse move  *)
  1007.   WFLG_GIMMEZEROZERO    = {10} ; (* a GimmeZeroZero window        *)
  1008.   WFLG_BORDERLESS    = {11} ; (* to get a Window sans border        *)
  1009.   WFLG_ACTIVATE        = {12} ; (* when Window opens, it's Active  *)
  1010.  
  1011. (* --- Other User Flags --------------------------------------------------- *)
  1012.  
  1013.   WFLG_RMBTRAP        = {16} ; (* Catch RMB events for your own   *)
  1014.   WFLG_NOCAREREFRESH    = {17} ; (* not to be bothered with REFRESH *)
  1015.  
  1016. (* - V36 new Flags which the programmer may specify in NewWindow.Flags    *)
  1017.   WFLG_NW_EXTENDED    = {18} ; (* extension data provided    *)
  1018.                  (* see struct ExtNewWindow    *)
  1019.  
  1020. (* - V39 new Flags which the programmer may specify in NewWindow.Flags    *)
  1021.   WFLG_NEWLOOKMENUS    = {21} ; (* window has NewLook menus    *)
  1022.  
  1023. (* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! *)
  1024.   WFLG_WINDOWACTIVE    = {13} ; (* this window is the active one  *)
  1025.   WFLG_INREQUEST    = {14} ; (* this window is in request mode *)
  1026.   WFLG_MENUSTATE    = {15} ; (* Window is active with Menus on *)
  1027.   WFLG_WINDOWREFRESH    = {24} ; (* Window is currently refreshing *)
  1028.   WFLG_WBENCHWINDOW    = {25} ; (* WorkBench tool ONLY Window       *)
  1029.   WFLG_WINDOWTICKED    = {26} ; (* only one timer tick at a time  *)
  1030.  
  1031. (* V36 and higher flags to be set only by Intuition: *)
  1032.   WFLG_VISITOR        = {27} ; (* visitor window        *)
  1033.   WFLG_ZOOMED        = {28} ; (* identifies "zoom state"    *)
  1034.   WFLG_HASZOOM        = {29} ; (* window has a zoom gadget    *)
  1035.  
  1036. (* --- Other Window Values ---------------------------------------------- *)
  1037.   DEFAULTMOUSEQUEUE    = 5 ;    (* no more mouse messages    *)
  1038.  
  1039. (* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- *)
  1040.  
  1041. (* ========================================================================== *)
  1042. (* === NewWindow ============================================================ *)
  1043. (* ========================================================================== *)
  1044. (*                                          *)
  1045. (* Note that the new extension fields have been removed.  Use ExtNewWindow    *)
  1046. (* structure below to make use of these fields                      *)
  1047.  
  1048. TYPE
  1049.   NewWindow = RECORD
  1050.     LeftEdge    : INTEGER ;
  1051.     TopEdge    : INTEGER ;    (* screen dimensions of window *)
  1052.     Width    : INTEGER ;
  1053.     Height    : INTEGER ;    (* screen dimensions of window *)
  1054.     DetailPen    : SHORTCARD ;
  1055.     BlockPen    : SHORTCARD ;    (* for bar/border/gadget rendering *)
  1056.  
  1057.     IDCMPFlags    : LONGSET ;    (* User-selected IDCMP flags       *)
  1058.  
  1059.     Flags    : LONGSET ;    (* see Window struct for defines   *)
  1060.  
  1061.     (* You supply a linked-list of Gadgets for your Window.              *)
  1062.     (*    This list DOES NOT include system Gadgets.  You get the standard      *)
  1063.     (*    system Window Gadgets by setting flag-bits in the variable Flags (see *)
  1064.     (*    the bit definitions under the Window structure definition)          *)
  1065.  
  1066.     FirstGadget : GadgetPtr ;
  1067.  
  1068.     (* the CheckMark is a pointer to the imagery that will be used when *)
  1069.     (* rendering MenuItems of this Window that want to be checkmarked    *)
  1070.     (* if this is equal to NULL, you'll get the default imagery        *)
  1071.  
  1072.     CheckMark    : ImagePtr ;
  1073.     Title    : STRING ;    (* the title text for this window *)
  1074.  
  1075.     (* the Screen pointer is used only if you've defined a CUSTOMSCREEN and *)
  1076.     (* want this Window to open in it.    If so, you pass the address of the  *)
  1077.     (* Custom Screen structure in this variable.  Otherwise, this variable  *)
  1078.     (* is ignored and doesn't have to be initialized.                *)
  1079.  
  1080.     Screen    : ScreenPtr ;
  1081.  
  1082.     (* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap     *)
  1083.     (* structure in this variable.  If not, this variable is ignored and *)
  1084.     (* doesn't have to be initialized                     *)
  1085.  
  1086.     BitMap    : BitMapPtr ;
  1087.  
  1088.     (* the values describe the minimum and maximum sizes of your Windows. *)
  1089.     (* these matter only if you've chosen the WFLG_SIZEGADGET option,      *)
  1090.     (* which means that you want to let the User to change the size of      *)
  1091.     (* this Window.  You describe the minimum and maximum sizes that the  *)
  1092.     (* Window can grow by setting these variables.  You can initialize      *)
  1093.     (* any one these to zero, which will mean that you want to duplicate  *)
  1094.     (* the setting for that dimension (if MinWidth == 0, MinWidth will be *)
  1095.     (* set to the opening Width of the Window).                  *)
  1096.     (* You can change these settings later using SetWindowLimits().      *)
  1097.     (* If you haven't asked for a SIZING Gadget, you don't have to      *)
  1098.     (* initialize any of these variables.                  *)
  1099.  
  1100.     MinWidth    : INTEGER ;
  1101.     MinHeight    : INTEGER ; (* minimums *)
  1102.     MaxWidth    : INTEGER ;
  1103.     MaxHeight    : INTEGER ; (* maximums *)
  1104.  
  1105.     (* the type variable describes the Screen in which you want this Window to*)
  1106.     (* open.  The type value can either be CUSTOMSCREEN or one of the          *)
  1107.     (* system standard Screen Types such as WBENCHSCREEN.  See the          *)
  1108.     (* type definitions under the Screen structure.                  *)
  1109.  
  1110.     Type    : BITSET ;
  1111.   END ;
  1112.  
  1113. (* The following structure is the future NewWindow.  Compatibility    *)
  1114. (* issues require that the size of NewWindow not change.        *)
  1115. (* Data in the common part (NewWindow) indicates the the extension    *)
  1116. (* fields are being used.                        *)
  1117. (* NOTE WELL: This structure may be subject to future extension.    *)
  1118. (* Writing code depending on its size is not allowed.            *)
  1119.  
  1120. TYPE
  1121.   ExtNewWindow = RECORD
  1122.     LeftEdge    : INTEGER ;
  1123.     TopEdge    : INTEGER ;
  1124.     Width    : INTEGER ;
  1125.     Height    : INTEGER ;
  1126.     DetailPen    : SHORTCARD ;
  1127.     BlockPen    : SHORTCARD ;
  1128.     IDCMPFlags    : LONGSET ;
  1129.     Flags    : LONGSET ;
  1130.     FirstGadget : GadgetPtr ;
  1131.     CheckMark    : ImagePtr ;
  1132.     Title    : STRING ;
  1133.     Screen    : ScreenPtr ;
  1134.     BitMap    : BitMapPtr ;
  1135.     MinWidth    : INTEGER ;
  1136.     MinHeight    : INTEGER ;
  1137.     MaxWidth    : CARDINAL ;
  1138.     MaxHeight    : CARDINAL ;
  1139.  
  1140.     (* the type variable describes the Screen in which you want this Window to*)
  1141.     (* open. The type value can either be CUSTOMSCREEN or one of the          *)
  1142.     (* system standard Screen Types such as WBENCHSCREEN.  See the          *)
  1143.     (* type definitions under the Screen structure.                  *)
  1144.     (* A new possible value for this field is PUBLICSCREEN, which          *)
  1145.     (* defines the window as a 'visitor' window.  See below for              *)
  1146.     (* additional information provided.                          *)
  1147.  
  1148.     Type    : BITSET ;
  1149.  
  1150.     (* ---------------------------------------------------------------- *)
  1151.     (* extensions for V36                        *)
  1152.     (* if the NewWindow Flag value WFLG_NW_EXTENDED is set, then    *)
  1153.     (* this field is assumed to point to an array ( or chain of arrays) *)
  1154.     (* of TagItem structures.  See also ExtNewScreen for another    *)
  1155.     (* use of TagItems to pass optional data.                *)
  1156.     (*                                    *)
  1157.     (* see below for tag values and the corresponding data.        *)
  1158.  
  1159.     Extension    : TagItemPtr ;
  1160.   END ;
  1161.  
  1162. (* The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.    *)
  1163. (* They are values in a TagItem array passed as extension/replacement    *)
  1164. (* values for the data in NewWindow.  OpenWindowTagList() can actually    *)
  1165. (* work well with a NULL NewWindow pointer.                *)
  1166.  
  1167. CONST
  1168.   WA_Dummy        = (TAG_USER + 99) ;    (* 0x80000063    *)
  1169.  
  1170. (* these tags simply override NewWindow parameters *)
  1171.   WA_Left        = (WA_Dummy + 001H) ;
  1172.   WA_Top        = (WA_Dummy + 002H) ;
  1173.   WA_Width        = (WA_Dummy + 003H) ;
  1174.   WA_Height        = (WA_Dummy + 004H) ;
  1175.   WA_DetailPen        = (WA_Dummy + 005H) ;
  1176.   WA_BlockPen        = (WA_Dummy + 006H) ;
  1177.  
  1178.   WA_IDCMP        = (WA_Dummy + 007H) ;
  1179.             (* "bulk" initialization of NewWindow.Flags *)
  1180.  
  1181.   WA_Flags        = (WA_Dummy + 008H) ;
  1182.   WA_Gadgets        = (WA_Dummy + 009H) ;
  1183.   WA_Checkmark        = (WA_Dummy + 00AH) ;
  1184.  
  1185.   WA_Title        = (WA_Dummy + 00BH) ;
  1186.             (* means you don't have to call SetWindowTitles *)
  1187.             (* after you open your window            *)
  1188.  
  1189.   WA_ScreenTitle    = (WA_Dummy + 00CH) ;
  1190.   WA_CustomScreen    = (WA_Dummy + 00DH) ;
  1191.  
  1192.   WA_SuperBitMap    = (WA_Dummy + 00EH) ;
  1193.             (* also implies WFLG_SUPER_BITMAP property    *)
  1194.  
  1195.   WA_MinWidth        = (WA_Dummy + 00FH) ;
  1196.   WA_MinHeight        = (WA_Dummy + 010H) ;
  1197.   WA_MaxWidth        = (WA_Dummy + 011H) ;
  1198.   WA_MaxHeight        = (WA_Dummy + 012H) ;
  1199.  
  1200. (* The following are specifications for new features    *)
  1201.  
  1202.   WA_InnerWidth        = (WA_Dummy + 013H) ;
  1203.   WA_InnerHeight    = (WA_Dummy + 014H) ;
  1204.             (* You can specify the dimensions of the interior *)
  1205.             (* region of your window, independent of what      *)
  1206.             (* the border widths will be.  You probably want  *)
  1207.             (* to also specify WA_AutoAdjust to allow      *)
  1208.             (* Intuition to move your window or even      *)
  1209.             (* shrink it so that it is completely on screen.  *)
  1210.  
  1211.   WA_PubScreenName    = (WA_Dummy + 015H) ;
  1212.             (* declares that you want the window to open as   *)
  1213.             (* a visitor on the public screen whose name is   *)
  1214.             (* pointed to by ( UBYTE * ) ti_Data          *)
  1215.  
  1216.   WA_PubScreen        = (WA_Dummy + 016H) ;
  1217.             (* open as a visitor window on the public screen      *)
  1218.             (* whose address is in ( struct Screen * ) ti_Data.   *)
  1219.             (* To ensure that this screen remains open, you          *)
  1220.             (* should either be the screen's owner, have a          *)
  1221.             (* window open on the screen, or use LockPubScreen(). *)
  1222.  
  1223.   WA_PubScreenFallBack    = (WA_Dummy + 017H) ;
  1224.             (* A Boolean, specifies whether a visitor window   *)
  1225.             (* should "fall back" to the default public screen *)
  1226.             (* (or Workbench) if the named public screen isn't *)
  1227.             (* available                       *)
  1228.  
  1229.   WA_WindowName        = (WA_Dummy + 018H) ;
  1230.             (* not implemented *)
  1231.  
  1232.   WA_Colors        = (WA_Dummy + 019H) ;
  1233.             (* a ColorSpec array for colors to be set       *)
  1234.             (* when this window is active.    This is not       *)
  1235.             (* implemented, and may not be, since the default  *)
  1236.             (* values to restore would be hard to track.       *)
  1237.             (* We'd like to at least support per-window colors *)
  1238.             (* for the mouse pointer sprite.           *)
  1239.  
  1240.   WA_Zoom        = (WA_Dummy + 01AH) ;
  1241.             (* ti_Data points to an array of four WORD's,      *)
  1242.             (* the initial Left/Top/Width/Height values of      *)
  1243.             (* the "alternate" zoom position/dimensions.      *)
  1244.             (* It also specifies that you want a Zoom gadget  *)
  1245.             (* for your window, whether or not you have a      *)
  1246.             (* sizing gadget.                  *)
  1247.  
  1248.   WA_MouseQueue        = (WA_Dummy + 01BH) ;
  1249.             (* ti_Data contains initial value for the mouse   *)
  1250.             (* message backlog limit for this window.      *)
  1251.  
  1252.   WA_BackFill        = (WA_Dummy + 01CH) ;
  1253.             (* provides a "backfill hook" for your window's Layer.*)
  1254.             (* See layers.library/CreateUpfrontHookLayer().       *)
  1255.  
  1256.   WA_RptQueue        = (WA_Dummy + 01DH) ;
  1257.             (* initial value of repeat key backlog limit    *)
  1258.  
  1259.     (* These Boolean tag items are alternatives to the NewWindow.Flags    *)
  1260.     (* boolean flags with similar names.                *)
  1261.  
  1262.   WA_SizeGadget        = (WA_Dummy + 01EH) ;
  1263.   WA_DragBar        = (WA_Dummy + 01FH) ;
  1264.   WA_DepthGadget    = (WA_Dummy + 020H) ;
  1265.   WA_CloseGadget    = (WA_Dummy + 021H) ;
  1266.   WA_Backdrop        = (WA_Dummy + 022H) ;
  1267.   WA_ReportMouse    = (WA_Dummy + 023H) ;
  1268.   WA_NoCareRefresh    = (WA_Dummy + 024H) ;
  1269.   WA_Borderless        = (WA_Dummy + 025H) ;
  1270.   WA_Activate        = (WA_Dummy + 026H) ;
  1271.   WA_RMBTrap        = (WA_Dummy + 027H) ;
  1272.   WA_WBenchWindow    = (WA_Dummy + 028H) ;    (* PRIVATE!! *)
  1273.  
  1274.   WA_SimpleRefresh    = (WA_Dummy + 029H) ;
  1275.             (* only specify if TRUE    *)
  1276.  
  1277.   WA_SmartRefresh    = (WA_Dummy + 02AH) ;
  1278.             (* only specify if TRUE    *)
  1279.  
  1280.   WA_SizeBRight        = (WA_Dummy + 02BH) ;
  1281.   WA_SizeBBottom    = (WA_Dummy + 02CH) ;
  1282.  
  1283.     (* New Boolean properties    *)
  1284.  
  1285.   WA_AutoAdjust        = (WA_Dummy + 02DH) ;
  1286.             (* shift or squeeze the window's position and    *)
  1287.             (* dimensions to fit it on screen.        *)
  1288.  
  1289.   WA_GimmeZeroZero    = (WA_Dummy + 02EH) ;
  1290.             (* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    *)
  1291.  
  1292. (* New for V37: WA_MenuHelp (ignored by V36) *)
  1293.  
  1294.   WA_MenuHelp        = (WA_Dummy + 02FH) ;
  1295.             (* Enables IDCMP_MENUHELP:  Pressing HELP during menus*)
  1296.             (* will return IDCMP_MENUHELP message.              *)
  1297.  
  1298. (* New for V39:  (ignored by V37 and earlier) *)
  1299.  
  1300.   WA_NewLookMenus    = (WA_Dummy + 030H) ;
  1301.             (* Set to TRUE if you want NewLook menus *)
  1302.  
  1303.   WA_AmigaKey        = (WA_Dummy + 031H) ;
  1304.             (* Pointer to image for Amiga-key equiv in menus *)
  1305.  
  1306.   WA_NotifyDepth    = (WA_Dummy + 032H) ;
  1307.             (* Requests IDCMP_CHANGEWINDOW message when    *)
  1308.             (* window is depth arranged            *)
  1309.             (* (imsg->Code = CWCODE_DEPTH)            *)
  1310.  
  1311. (* WA_Dummy + 033H is obsolete *)
  1312.  
  1313.   WA_Pointer        = (WA_Dummy + 034H) ;
  1314.             (* Allows you to specify a custom pointer    *)
  1315.             (* for your window.  ti_Data points to a    *)
  1316.             (* pointer object you obtained via        *)
  1317.             (* "pointerclass". NULL signifies the        *)
  1318.             (* default pointer.                *)
  1319.             (* This tag may be passed to OpenWindowTags()    *)
  1320.             (* or SetWindowPointer().            *)
  1321.  
  1322.   WA_BusyPointer    = (WA_Dummy + 035H) ;
  1323.             (* ti_Data is boolean.    Set to TRUE to        *)
  1324.             (* request the standard busy pointer.        *)
  1325.             (* This tag may be passed to OpenWindowTags()    *)
  1326.             (* or SetWindowPointer().            *)
  1327.  
  1328.   WA_PointerDelay    = (WA_Dummy + 036H) ;
  1329.             (* ti_Data is boolean.    Set to TRUE to        *)
  1330.             (* request that the changing of the        *)
  1331.             (* pointer be slightly delayed.  The change    *)
  1332.             (* will be called off if you call NewSetPointer *)
  1333.             (* before the delay expires.  This allows    *)
  1334.             (* you to post a busy-pointer even if you think    *)
  1335.             (* the busy-time may be very short, without    *)
  1336.             (* fear of a flashing pointer.            *)
  1337.             (* This tag may be passed to OpenWindowTags()    *)
  1338.             (* or SetWindowPointer().            *)
  1339.  
  1340.   WA_TabletMessages    = (WA_Dummy + 037H) ;
  1341.             (* ti_Data is a boolean.  Set to TRUE to    *)
  1342.             (* request that tablet information be included    *)
  1343.             (* in IntuiMessages sent to your window.    *)
  1344.             (* Requires that something (ie.a tablet driver) *)
  1345.             (* feed IESUBCLASS_NEWTABLET InputEvents into   *)
  1346.             (* the system.For a pointer to the TabletData,  *)
  1347.             (* examine the ExtIntuiMessage->eim_TabletData  *)
  1348.             (* field.  It is UNSAFE to check this field     *)
  1349.             (* when running on pre-V39 systems. It's always *)
  1350.             (* safe to check this field under V39 and up,   *)
  1351.             (* though it may be NULL.            *)
  1352.  
  1353.   WA_HelpGroup        = (WA_Dummy + 038H) ;
  1354.             (* When the active window has gadget help enabled,    *)
  1355.             (* other windows of the same HelpGroup number         *)
  1356.             (* will also get GadgetHelp.  This allows GadgetHelp  *)
  1357.             (* to work for multi-windowed applications.          *)
  1358.             (* Use GetGroupID() to get an ID number.  Pass        *)
  1359.             (* this number as ti_Data to all your windows.          *)
  1360.             (* See also the HelpControl() function.              *)
  1361.  
  1362.   WA_HelpGroupWindow    = (WA_Dummy + 039H) ;
  1363.             (* When the active window has gadget help enabled,    *)
  1364.             (* other windows of the same HelpGroup will also get  *)
  1365.             (* GadgetHelp.    This allows GadgetHelp to work          *)
  1366.             (* for multi-windowed applications.  As an alternative*)
  1367.             (* to WA_HelpGroup, you can pass a pointer to any     *)
  1368.             (* other window of the same group to join its help    *)
  1369.             (* group.  Defaults to NULL, which has no effect.     *)
  1370.             (* See also the HelpControl() function.              *)
  1371.  
  1372. (* HelpControl() flags:                            *)
  1373. (* HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more    *)
  1374. (* windows.                                *)
  1375.  
  1376.   HC_GADGETHELP    = {0} ;
  1377.  
  1378. (* ======================================================================== *)
  1379. (* === DrawInfo =========================================================== *)
  1380. (* ======================================================================== *)
  1381.  
  1382. (* This is a packet of information for graphics rendering.  It originates   *)
  1383. (* with a Screen, and is gotten using GetScreenDrawInfo( screen );        *)
  1384.  
  1385. (* You can use the Intuition version number to tell which fields are    *)
  1386. (* present in this structure.                        *)
  1387. (*                                    *)
  1388. (* DRI_VERSION of 1 corresponds to V37 release.                *)
  1389. (* DRI_VERSION of 2 corresponds to V39, and includes three new pens    *)
  1390. (*    and the dri_CheckMark and dri_AmigaKey fields.            *)
  1391. (*                                    *)
  1392. (* Note that sometimes applications need to create their own DrawInfo    *)
  1393. (* structures, in which case the DRI_VERSION won't correspond exactly    *)
  1394. (* to the OS version!!!                            *)
  1395.  
  1396. CONST
  1397.   DRI_VERSION = 2 ;
  1398.  
  1399. TYPE
  1400.   DrawInfo = RECORD
  1401.     dri_Version      : CARDINAL ;    (* will be  DRI_VERSION            *)
  1402.     dri_NumPens      : CARDINAL ;    (* guaranteed to be >= 9        *)
  1403.     dri_Pens      : ADDRESS  ;    (* pointer to pen array            *)
  1404.  
  1405.     dri_Font      : TextFontPtr;(* screen default font            *)
  1406.     dri_Depth      : CARDINAL ;    (* (initial) depth of screen bitmap    *)
  1407.  
  1408.     dri_Resolution: RECORD X,Y : CARDINAL END ;
  1409.         (* from DisplayInfo database for initial display mode    *)
  1410.  
  1411.     dri_Flags      : LONGSET ;    (* defined below *)
  1412.  
  1413.     (* New for V39: dri_CheckMark, dri_AmigaKey. *)
  1414.  
  1415.     dri_CheckMark : ImagePtr ;    (* pointer to scaled checkmark image    *)
  1416.                 (* Will be NULL if DRI_VERSION < 2    *)
  1417.  
  1418.     dri_AmigaKey  : ImagePtr ;    (* pointer to scaled Amiga-key image    *)
  1419.                 (* Will be NULL if DRI_VERSION < 2    *)
  1420.  
  1421.     dri_Reserved  : ARRAY [0..4] OF LONGINT ;
  1422.                     (* avoid recompilation ;^) *)
  1423.   END ;
  1424.  
  1425. CONST
  1426.   DRIF_NEWLOOK       = 00001H ;    (* specified SA_Pens, full treatment *)
  1427.  
  1428. (* rendering pen number indexes into DrawInfo.dri_Pens[]    *)
  1429.   DETAILPEN       = 00000H ;    (* compatible Intuition rendering pens    *)
  1430.   BLOCKPEN       = 00001H ;    (* compatible Intuition rendering pens    *)
  1431.   TEXTPEN       = 00002H ;    (* text on background            *)
  1432.   SHINEPEN       = 00003H ;    (* bright edge on 3D objects        *)
  1433.   SHADOWPEN       = 00004H ;    (* dark edge on 3D objects        *)
  1434.   FILLPEN       = 00005H ;     (* active-window/selected-gadget fill    *)
  1435.   FILLTEXTPEN       = 00006H ;    (* text over FILLPEN            *)
  1436.   BACKGROUNDPEN       = 00007H ;    (* always color 0            *)
  1437.   HIGHLIGHTTEXTPEN = 00008H ;    (* special color text, on background    *)
  1438. (* New for V39, only present if DRI_VERSION >= 2: *)
  1439.   BARDETAILPEN       = 00009H ;    (* text/detail in screen-bar/menus    *)
  1440.   BARBLOCKPEN       = 0000AH ;    (* screen-bar/menus fill        *)
  1441.   BARTRIMPEN       = 0000BH ;    (* trim under screen-bar        *)
  1442.  
  1443.   NUMDRIPENS       = 0000CH ;
  1444.  
  1445. (* New for V39:  It is sometimes useful to specify that a pen value    *)
  1446. (* is to be the complement of color zero to three.  The "magic" numbers    *)
  1447. (* serve that purpose:                            *)
  1448.  
  1449.   PEN_C3 = 0FEFCH ; (* Complement of color 3 *)
  1450.   PEN_C2 = 0FEFDH ; (* Complement of color 2 *)
  1451.   PEN_C1 = 0FEFEH ; (* Complement of color 1 *)
  1452.   PEN_C0 = 0FEFFH ; (* Complement of color 0 *)
  1453.  
  1454. (* ======================================================================== *)
  1455. (* === Screen ============================================================= *)
  1456. (* ======================================================================== *)
  1457.  
  1458. (* VERY IMPORTANT NOTE ABOUT Screen->BitMap.  In the future, bitmaps    *)
  1459. (* will need to grow.  The embedded instance of a bitmap in the screen    *)
  1460. (* will no longer be large enough to hold the whole description of    *)
  1461. (* the bitmap.                                *)
  1462. (*                                    *)
  1463. (* YOU ARE STRONGLY URGED to use Screen->RastPort.BitMap in place of    *)
  1464. (* &Screen->BitMap whenever and whereever possible.            *)
  1465.  
  1466. TYPE
  1467.   Screen = RECORD
  1468.     NextScreen  : ScreenPtr ;    (* linked list of screens        *)
  1469.     FirstWindow : WindowPtr ;    (* linked list Screen's Windows        *)
  1470.     LeftEdge    : INTEGER ;
  1471.     TopEdge    : INTEGER ;    (* parameters of the screen        *)
  1472.     Width    : INTEGER ;
  1473.     Height    : INTEGER ;    (* parameters of the screen        *)
  1474.     MouseY    : INTEGER ;
  1475.     MouseX    : INTEGER ;    (* position relative to upper-left    *)
  1476.     Flags    : BITSET ;    (* see definitions below        *)
  1477.     Title    : STRING ;    (* null-terminated Title text        *)
  1478.     DefaultTitle: STRING ;    (* for Windows without ScreenTitle    *)
  1479.  
  1480.     (* Bar sizes for this Screen and all Window's in this Screen    *)
  1481.     (* Note that BarHeight is one less than the actual menu bar        *)
  1482.     (* height.    We're going to keep this in V36 for compatibility,    *)
  1483.     (* although V36 artwork might use that extra pixel            *)
  1484.     (*                                    *)
  1485.     (* Also, the title bar height of a window is calculated from the    *)
  1486.     (* screen's WBorTop field, plus the font height, plus one.        *)
  1487.  
  1488.     BarHeight    : SHORTINT ;
  1489.     BarVBorder    : SHORTINT ;
  1490.     BarHBorder  : SHORTINT ;
  1491.     MenuVBorder : SHORTINT ;
  1492.     MenuHBorder : SHORTINT ;
  1493.     WBorTop    : SHORTINT ;
  1494.     WBorLeft    : SHORTINT ;
  1495.     WBorRight    : SHORTINT ;
  1496.     WBorBottom    : SHORTINT ;
  1497.  
  1498.     Font    : TextAttrPtr ;        (* this screen's default font       *)
  1499.  
  1500.     (* the display data structures for this Screen *)
  1501.     ViewPort    : Graphics.ViewPort ;    (* describing the Screen's display *)
  1502.     RastPort    : Graphics.RastPort ;    (* describing Screen rendering       *)
  1503.     BitMap    : Graphics.BitMap   ;    (* SEE WARNING ABOVE!           *)
  1504.     LayerInfo    : Layer_Info        ;    (* each screen gets a LayerInfo    *)
  1505.  
  1506.     (* Only system gadgets may be attached to a screen.               *)
  1507.     (*    You get the standard system Screen Gadgets automatically       *)
  1508.  
  1509.     FirstGadget : GadgetPtr ;
  1510.  
  1511.     DetailPen    : SHORTCARD ;
  1512.     BlockPen    : SHORTCARD ;    (* for bar/border/gadget rendering *)
  1513.  
  1514.     (* the following variable(s) are maintained by Intuition to support the *)
  1515.     (* DisplayBeep() color flashing technique                    *)
  1516.  
  1517.     SaveColor0    : CARDINAL ;
  1518.  
  1519.     (* This layer is for the Screen and Menu bars *)
  1520.     BarLayer    : LayerPtr ;
  1521.     ExtData    : ADDRESS ;
  1522.     UserData    : ADDRESS ; (* general-purpose pointer to User data extension *)
  1523.  
  1524.     (**** Data below this point are SYSTEM PRIVATE ****)
  1525.   END ;
  1526.  
  1527. CONST
  1528. (* --- FLAGS SET BY INTUITION --------------------------------------------- *)
  1529. (* The SCREENTYPE bits are reserved for describing various Screen types     *)
  1530. (* available under Intuition.                            *)
  1531.  
  1532.   SCREENTYPE    = {0..3} ;    (* all the screens types available *)
  1533.  
  1534. (* --- the definitions for the Screen Type ------------------------------- *)
  1535.   WBENCHSCREEN    = {0} ;    (* identifies the Workbench screen      *)
  1536.   PUBLICSCREEN    = {1} ;    (* public shared (custom) screen      *)
  1537.   CUSTOMSCREEN    = {0..3} ;
  1538.               (* original custom screens          *)
  1539.  
  1540.   SHOWTITLE    = {4} ;    (* this gets set by a call to ShowTitle() *)
  1541.  
  1542.   BEEPING    = {5} ;    (* set when Screen is beeping (private)      *)
  1543.  
  1544.   CUSTOMBITMAP    = {6} ;    (* if you are supplying your own BitMap   *)
  1545.  
  1546.   SCREENBEHIND    = {7} ;    (* if you want your screen to open behind *)
  1547.             (* already open screens              *)
  1548.  
  1549.   SCREENQUIET    = {8} ;    (* if you do not want Intuition to render *)
  1550.             (* into your screen (gadgets, title)      *)
  1551.  
  1552.   SCREENHIRES    = {9} ;    (* do not use lowres gadgets  (private)      *)
  1553.  
  1554.   NS_EXTENDED    = {12} ;(* ExtNewScreen.Extension is valid      *)
  1555. (* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED    *)
  1556.  
  1557.   AUTOSCROLL    = {14} ; (* screen is to autoscoll          *)
  1558.  
  1559. (* New for V39: *)
  1560.   PENSHARED    = {10} ; (* Screen opener set {SA_SharePens,TRUE} *)
  1561.  
  1562.   STDSCREENHEIGHT =-1 ; (* supply in NewScreen.Height          *)
  1563.   STDSCREENWIDTH  =-1 ; (* supply in NewScreen.Width          *)
  1564.  
  1565. (* Screen attribute tag ID's.  These are used in the ti_Tag field of    *)
  1566. (* TagItem arrays passed to OpenScreenTagList() (or in the        *)
  1567. (* ExtNewScreen.Extension field).                    *)
  1568.  
  1569. (* Screen attribute tags.  Please use these versions, not those in    *)
  1570. (* iobsolete.h. (below)                            *)
  1571.  
  1572. CONST
  1573.   SA_Dummy    = (TAG_USER + 32) ;
  1574.  
  1575. (* these items specify items equivalent to fields in NewScreen *)
  1576.  
  1577.   SA_Left    = (SA_Dummy + 00001H) ;
  1578.   SA_Top    = (SA_Dummy + 00002H) ;
  1579.   SA_Width    = (SA_Dummy + 00003H) ;
  1580.  
  1581.   SA_Height    = (SA_Dummy + 00004H) ;
  1582.             (* traditional screen positions    and dimensions    *)
  1583.  
  1584.   SA_Depth    = (SA_Dummy + 00005H) ;
  1585.             (* screen bitmap depth                *)
  1586.  
  1587.   SA_DetailPen    = (SA_Dummy + 00006H) ;
  1588.             (* serves as default for windows, too        *)
  1589.  
  1590.   SA_BlockPen    = (SA_Dummy + 00007H) ;
  1591.  
  1592.   SA_Title    = (SA_Dummy + 00008H) ;
  1593.             (* default screen title                *)
  1594.  
  1595.   SA_Colors    = (SA_Dummy + 00009H) ;
  1596.             (* ti_Data is an array of struct ColorSpec,    *)
  1597.             (* terminated by ColorIndex = -1.  Specifies    *)
  1598.             (* initial screen palette colors.        *)
  1599.             (* Also see SA_Colors32 for use under V39.    *)
  1600.  
  1601.   SA_ErrorCode    = (SA_Dummy + 0000AH) ;
  1602.             (* ti_Data points to LONG error code (values below)*)
  1603.  
  1604.   SA_Font    = (SA_Dummy + 0000BH) ;
  1605.             (* equiv. to NewScreen.Font            *)
  1606.  
  1607.   SA_SysFont    = (SA_Dummy + 0000CH) ;
  1608.             (* Selects one of the preferences system fonts: *)
  1609.             (*    0 - old DefaultFont, fixed-width    *)
  1610.             (*    1 - WB Screen preferred font        *)
  1611.  
  1612.   SA_Type    = (SA_Dummy + 0000DH) ;
  1613.             (* ti_Data is PUBLICSCREEN or CUSTOMSCREEN.  For other*)
  1614.             (* fields of NewScreen.Type, see individual tags,     *)
  1615.             (* eg. SA_Behind, SA_Quiet.                  *)
  1616.  
  1617.   SA_BitMap    = (SA_Dummy + 0000EH) ;
  1618.             (* ti_Data is pointer to custom BitMap.  This    *)
  1619.             (* implies type of CUSTOMBITMAP            *)
  1620.  
  1621.   SA_PubName    = (SA_Dummy + 0000FH) ;
  1622.             (* presence of this tag means that the screen    *)
  1623.             (* is to be a public screen.  Please specify    *)
  1624.             (* BEFORE the two tags below            *)
  1625.  
  1626.   SA_PubSig    = (SA_Dummy + 00010H) ;
  1627.  
  1628.   SA_PubTask    = (SA_Dummy + 00011H) ;
  1629.             (* Task ID and signal for being notified that      *)
  1630.             (* the last window has closed on a public screen. *)
  1631.  
  1632.   SA_DisplayID    = (SA_Dummy + 00012H) ;
  1633.             (* ti_Data is new extended display ID from    *)
  1634.             (* <graphics/displayinfo.h> (V37) or from    *)
  1635.             (* <graphics/modeid.h> (V39 and up)        *)
  1636.  
  1637.   SA_DClip    = (SA_Dummy + 00013H) ;
  1638.             (* ti_Data points to a rectangle which defines    *)
  1639.             (* screen display clip region            *)
  1640.  
  1641.   SA_Overscan    = (SA_Dummy + 00014H) ;
  1642.             (* Set to one of the OSCAN_               *)
  1643.             (* specifiers below to get a system standard       *)
  1644.             (* overscan region for your display clip,       *)
  1645.             (* screen dimensions (unless otherwise specified), *)
  1646.             (* and automatically centered position (partial    *)
  1647.             (* support only so far).               *)
  1648.             (* If you use this, you shouldn't specify       *)
  1649.             (* SA_DClip.  SA_Overscan is for "standard"       *)
  1650.             (* overscan dimensions, SA_DClip is for           *)
  1651.             (* your custom numeric specifications.           *)
  1652.  
  1653.   SA_Obsolete1    = (SA_Dummy + 00015H) ;
  1654.             (* obsolete S_MONITORNAME            *)
  1655.  
  1656. (** booleans **)
  1657.  
  1658.   SA_ShowTitle    = (SA_Dummy + 00016H) ;
  1659.             (* boolean equivalent to flag SHOWTITLE        *)
  1660.  
  1661.   SA_Behind    = (SA_Dummy + 00017H) ;
  1662.             (* boolean equivalent to flag SCREENBEHIND    *)
  1663.  
  1664.   SA_Quiet    = (SA_Dummy + 00018H) ;
  1665.             (* boolean equivalent to flag SCREENQUIET    *)
  1666.  
  1667.   SA_AutoScroll    = (SA_Dummy + 00019H) ;
  1668.             (* boolean equivalent to flag AUTOSCROLL    *)
  1669.  
  1670.   SA_Pens    = (SA_Dummy + 0001AH) ;
  1671.             (* pointer to ~0 terminated UWORD array, as    *)
  1672.             (* found in struct DrawInfo            *)
  1673.  
  1674.   SA_FullPalette= (SA_Dummy + 0001BH) ;
  1675.             (* boolean: initialize color table to entire      *)
  1676.             (*  preferences palette (32 for V36), rather      *)
  1677.             (* than compatible pens 0-3, 17-19, with      *)
  1678.             (* remaining palette as returned by GetColorMap() *)
  1679.  
  1680.   SA_ColorMapEntries = (SA_Dummy + 0001CH) ;
  1681.             (* New for V39:                       *)
  1682.             (* Allows you to override the number of entries       *)
  1683.             (* in the ColorMap for your screen.  Intuition       *)
  1684.             (* normally allocates (1<<depth) or 32, whichever  *)
  1685.             (* is more, but you may require even more if you   *)
  1686.             (* use certain V39 graphics.library features       *)
  1687.             (* (eg. palette-banking).               *)
  1688.  
  1689.   SA_Parent    = (SA_Dummy + 0001DH) ;
  1690.             (* New for V39:                       *)
  1691.             (* ti_Data is a pointer to a "parent" screen to       *)
  1692.             (* attach this one to.    Attached screens slide       *)
  1693.             (* and depth-arrange together.               *)
  1694.  
  1695.   SA_Draggable    = (SA_Dummy + 0001EH) ;
  1696.             (* New for V39:                       *)
  1697.             (* Boolean tag allowing non-draggable screens.       *)
  1698.             (* Do not use without good reason!           *)
  1699.             (* (Defaults to TRUE).                   *)
  1700.  
  1701.   SA_Exclusive    = (SA_Dummy + 0001FH) ;
  1702.             (* New for V39:                          *)
  1703.             (* Boolean tag allowing screens that won't share      *)
  1704.             (* the display.  Use sparingly!  Starting with 3.01,  *)
  1705.             (* attached screens may be SA_Exclusive.  Setting     *)
  1706.             (* SA_Exclusive for each screen will produce an          *)
  1707.             (* exclusive family.   (Defaults to FALSE).          *)
  1708.  
  1709.   SA_SharePens    = (SA_Dummy + 00020H) ;
  1710.             (* New for V39:                          *)
  1711.             (* For those pens in the screen's DrawInfo->dri_Pens, *)
  1712.             (* Intuition obtains them in shared mode (see         *)
  1713.             (* graphics.library/ObtainPen()).  For compatibility, *)
  1714.             (* Intuition obtains the other pens of a public       *)
  1715.             (* screen as PEN_EXCLUSIVE.  Screens that wish to     *)
  1716.             (* manage the pens themselves should generally set    *)
  1717.             (* this tag to TRUE.  This instructs Intuition to     *)
  1718.             (* leave the other pens unallocated.              *)
  1719.  
  1720.   SA_BackFill    = (SA_Dummy + 00021H) ;
  1721.             (* New for V39:                    *)
  1722.             (* provides a "backfill hook" for your screen's *)
  1723.             (* Layer_Info.                    *)
  1724.             (* See layers.library/InstallLayerInfoHook()    *)
  1725.  
  1726.   SA_Interleaved = (SA_Dummy + 00022H) ;
  1727.             (* New for V39:                    *)
  1728.             (* Boolean tag requesting that the bitmap    *)
  1729.             (* allocated for you be interleaved.        *)
  1730.             (* (Defaults to FALSE).                *)
  1731.  
  1732.   SA_Colors32    = (SA_Dummy + 00023H) ;
  1733.             (* New for V39:                    *)
  1734.             (* Tag to set the screen's initial palette    *)
  1735.             (* colors at 32 bits-per-gun. ti_Data is a    *)
  1736.             (* pointer to a table to be passed to the    *)
  1737.             (* graphics.library/LoadRGB32() function.    *)
  1738.             (* This format supports both runs of color    *)
  1739.             (* registers and sparse registers.  See the    *)
  1740.             (* autodoc for that function for full details.    *)
  1741.             (* Any color set here has precedence over    *)
  1742.             (* the same register set by SA_Colors.        *)
  1743.  
  1744.   SA_VideoControl = (SA_Dummy + 00024H) ;
  1745.             (* New for V39:                        *)
  1746.             (* ti_Data is a pointer to a taglist that Intuition *)
  1747.             (* will pass to graphics.library/VideoControl(),    *)
  1748.             (* upon opening the screen.                *)
  1749.  
  1750.   SA_FrontChild    = (SA_Dummy + 00025H) ;
  1751.             (* New for V39:                      *)
  1752.             (* ti_Data is a pointer to an already open screen *)
  1753.             (* that is to be the child of the screen being    *)
  1754.             (* opened.  The child screen will be moved to the *)
  1755.             (* front of its family.                  *)
  1756.  
  1757.   SA_BackChild    = (SA_Dummy + 00026H) ;
  1758.             (* New for V39:                      *)
  1759.             (* ti_Data is a pointer to an already open screen *)
  1760.             (* that is to be the child of the screen being    *)
  1761.             (* opened.  The child screen will be moved to the *)
  1762.             (* back of its family.                  *)
  1763.  
  1764.   SA_LikeWorkbench = (SA_Dummy + 00027H) ;
  1765.             (* New for V39:                    *)
  1766.             (* Set ti_Data to 1 to request a screen which    *)
  1767.             (* is just like the Workbench.    This gives    *)
  1768.             (* you the same screen mode, depth, size,    *)
  1769.             (* colors, etc., as the Workbench screen.    *)
  1770.  
  1771.   SA_Reserved    = (SA_Dummy + 00028H) ;
  1772.             (* Reserved for private Intuition use        *)
  1773.  
  1774.   SA_MinimizeISG = (SA_Dummy + 00029H) ;
  1775.             (* New for V40:                    *)
  1776.             (* For compatibility, Intuition always ensures    *)
  1777.             (* that the inter-screen gap is at least three    *)
  1778.             (* non-interlaced lines.  If your application    *)
  1779.             (* would look best with the smallest possible    *)
  1780.             (* inter-screen gap, set ti_Data to TRUE.    *)
  1781.             (* If you use the new graphics VideoControl()    *)
  1782.             (* VC_NoColorPaletteLoad tag for your screen's  *)
  1783.             (* ViewPort, you should also set this tag.    *)
  1784.  
  1785. (* this is an obsolete tag included only for compatibility with V35    *)
  1786. (* interim release for the A2024 and Viking monitors            *)
  1787.  
  1788. CONST
  1789.   NSTAG_EXT_VPMODE    = (TAG_USER + 1) ;
  1790.  
  1791. (* OpenScreen error codes, which are returned in the (optional) LONG    *)
  1792. (* pointed to by ti_Data for the SA_ErrorCode tag item            *)
  1793.  
  1794. CONST
  1795.   OSERR_NOMONITOR    = 1 ;    (* named monitor spec not available    *)
  1796.   OSERR_NOCHIPS        = 2 ;    (* you need newer custom chips        *)
  1797.   OSERR_NOMEM        = 3 ;    (* couldn't get normal memory        *)
  1798.   OSERR_NOCHIPMEM    = 4 ;    (* couldn't get chipmem            *)
  1799.   OSERR_PUBNOTUNIQUE    = 5 ;    (* public screen name already used    *)
  1800.   OSERR_UNKNOWNMODE    = 6 ;    (* don't recognize mode asked for    *)
  1801.   OSERR_TOODEEP        = 7 ;    (* Screen deeper than HW supports    *)
  1802.   OSERR_ATTACHFAIL    = 8 ;    (* Failed to attach screens        *)
  1803.   OSERR_NOTAVAILABLE    = 9 ;    (* Mode not available for other reason    *)
  1804.  
  1805. (* ========================================================================== *)
  1806. (* === NewScreen ============================================================ *)
  1807. (* ========================================================================== *)
  1808. (* note: to use the Extended field, you must use the                  *)
  1809. (* new ExtNewScreen structure, below                          *)
  1810.  
  1811. TYPE
  1812.   NewScreen = RECORD
  1813.     LeftEdge    : INTEGER ;    (* screen dimensions *)
  1814.     TopEdge    : INTEGER ;
  1815.     Width    : INTEGER ;
  1816.     Height    : INTEGER ;
  1817.     Depth    : INTEGER ;
  1818.     DetailPen    : SHORTCARD ;    (* for bar/border/gadget rendering     *)
  1819.     BlockPen    : SHORTCARD ;
  1820.     ViewModes    : BITSET ;    (* the Modes for the ViewPort (and View) *)
  1821.     Type    : BITSET;    (* the Screen type (see defines above)     *)
  1822.     Font    : TextAttrPtr ;    (* this Screen's default text attributes *)
  1823.     DefaultTitle: STRING ;    (* the default title for this Screen     *)
  1824.     Gadgets    : GadgetPtr ;    (* UNUSED:  Leave this NULL         *)
  1825.  
  1826.     (* if you are opening a CUSTOMSCREEN and already have a BitMap          *)
  1827.     (* that you want used for your Screen, you set the flags CUSTOMBITMAP in  *)
  1828.     (* the Type field and you set this variable to point to your BitMap       *)
  1829.     (* structure.  The structure will be copied into your Screen structure,   *)
  1830.     (* after which you may discard your own BitMap if you want              *)
  1831.  
  1832.     CustomBitMap: BitMapPtr ;
  1833.   END ;
  1834.  
  1835. (* For compatibility reasons, we need a new structure for extending      *)
  1836. (* NewScreen.  Use this structure is you need to use the new Extension      *)
  1837. (* field.                                  *)
  1838. (*                                      *)
  1839. (* NOTE: V36-specific applications should use the              *)
  1840. (* OpenScreenTagList( newscreen, tags ) version of OpenScreen().      *)
  1841. (* Applications that want to be V34-compatible as well may safely use the *)
  1842. (* ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.    *)
  1843.  
  1844.   ExtNewScreen = RECORD
  1845.     LeftEdge    : INTEGER ;
  1846.     TopEdge    : INTEGER ;
  1847.     Width    : INTEGER ;
  1848.     Height    : INTEGER ;
  1849.     Depth    : INTEGER ;
  1850.     DetailPen    : SHORTCARD ;
  1851.     BlockPen    : SHORTCARD ;
  1852.     ViewModes    : BITSET ;
  1853.     Type    : BITSET ;
  1854.     Font    : TextAttrPtr ;
  1855.     DefaultTitle: STRING ;
  1856.     Gadgets    : GadgetPtr ;
  1857.     CustomBitMap: BitMapPtr ;
  1858.     Extension    : TagItemPtr ;
  1859.         (* more specification data, scanned if  *)
  1860.         (* NS_EXTENDED is set in NewScreen.Type *)
  1861.   END ;
  1862.  
  1863. CONST
  1864. (* === Overscan Types === *)
  1865.   OSCAN_TEXT     = 1 ;    (* entirely visible        *)
  1866.   OSCAN_STANDARD = 2 ;    (* just past edges        *)
  1867.   OSCAN_MAX     = 3 ;    (* as much as possible        *)
  1868.   OSCAN_VIDEO     = 4 ;    (* even more than is possible    *)
  1869.  
  1870. (* === Public Shared Screen Node === *)
  1871.  
  1872. (* This is the representative of a public shared screen.        *)
  1873. (* This is an internal data structure, but some functions may        *)
  1874. (* present a copy of it to the calling application.  In that case,    *)
  1875. (* be aware that the screen pointer of the structure can NOT be        *)
  1876. (* used safely, since there is no guarantee that the referenced        *)
  1877. (* screen will remain open and a valid data structure.            *)
  1878. (*                                    *)
  1879. (* Never change one of these.                        *)
  1880.  
  1881. TYPE
  1882.   PubScreenNode    = RECORD
  1883.     psn_Node        : Node ;    (* ln_Name is screen name        *)
  1884.     psn_Screen        : ScreenPtr ;
  1885.     psn_Flags        : BITSET ;    (* below                *)
  1886.     psn_Size        : INTEGER ;    (* includes name buffer            *)
  1887.     psn_VisitorCount    : INTEGER ;    (* how many visitor windows        *)
  1888.     psn_SigTask        : TaskPtr ;    (* who to signal when visitors gone *)
  1889.     psn_SigBit        : SHORTSET ;    (* which signal                *)
  1890.   END ;
  1891.  
  1892. CONST
  1893.   PSNF_PRIVATE = {0} ;
  1894.  
  1895. (* NOTE: Due to a bug in NextPubScreen(), make sure your buffer *)
  1896. (* actually has MAXPUBSCREENNAME+1 characters in it!        *)
  1897.  
  1898.   MAXPUBSCREENNAME = 139 ;    (* names no longer, please    *)
  1899.  
  1900. (* pub screen modes    *)
  1901.   SHANGHAI    = {0} ;    (* put workbench windows on pub screen          *)
  1902.   POPPUBSCREEN    = {1} ;    (* pop pub screen to front when visitor opens *)
  1903.  
  1904. (* New for V39:  Intuition has new screen depth-arrangement and movement *)
  1905. (* functions called ScreenDepth() and ScreenPosition() respectively.     *)
  1906. (* These functions permit the old behavior of ScreenToFront(),         *)
  1907. (* ScreenToBack(), and MoveScreen().  ScreenDepth() also allows         *)
  1908. (* independent depth control of attached screens.  ScreenPosition()     *)
  1909. (* optionally allows positioning screens even though they were opened     *)
  1910. (* {SA_Draggable,FALSE}.                         *)
  1911.  
  1912. (* For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,     *)
  1913. (* and optionally also SDEPTH_INFAMILY.                     *)
  1914. (*                                     *)
  1915. (* NOTE: ONLY THE OWNER OF THE SCREEN should ever specify         *)
  1916. (* SDEPTH_INFAMILY.  Commodities, "input helper" programs,         *)
  1917. (* or any other program that did not open a screen should never         *)
  1918. (* use that flag.  (Note that this is a style-behavior             *)
  1919. (* requirement;  there is no technical requirement that the         *)
  1920. (* task calling this function need be the task which opened         *)
  1921. (* the screen).                                 *)
  1922.  
  1923.   SDEPTH_TOFRONT    = {}  ;    (* Bring screen to front    *)
  1924.   SDEPTH_TOBACK        = {0} ;    (* Send screen to back        *)
  1925.   SDEPTH_INFAMILY    = {1} ;    (* Move an attached screen with *)
  1926.                 (* respect to other screens of    *)
  1927.                 (* its family            *)
  1928.  
  1929. (* Here's an obsolete name equivalent to SDEPTH_INFAMILY: *)
  1930.   SDEPTH_CHILDONLY    = SDEPTH_INFAMILY ;
  1931.  
  1932.  
  1933. (* For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  1934.  * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  1935.  * wish to perform:
  1936.  *
  1937.  * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  1938.  *    the offset in coordinates you wish to move the screen by.
  1939.  * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  1940.  *    the absolute coordinates you wish to move the screen to.
  1941.  * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  1942.  *    screen which you would like autoscrolled into view.
  1943.  *
  1944.  * You may additionally set SPOS_FORCEDRAG along with any of the
  1945.  * above.  Set this if you wish to reposition an {SA_Draggable,FALSE}
  1946.  * screen that you opened.
  1947.  *
  1948.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  1949.  * SPOS_FORCEDRAG.  Commodities, "input helper" programs,
  1950.  * or any other program that did not open a screen should never
  1951.  * use that flag.
  1952.  *)
  1953.  
  1954.   SPOS_RELATIVE        = { } ;    (* Coordinates are relative     *)
  1955.  
  1956.   SPOS_ABSOLUTE        = {0} ;    (* Coordinates are expressed as  *)
  1957.                 (* absolutes, not relatives.     *)
  1958.  
  1959.   SPOS_MAKEVISIBLE    = {1} ;    (* Coordinates describe a box on *)
  1960.                 (* the screen you wish to be     *)
  1961.                 (* made visible by autoscrolling *)
  1962.  
  1963.   SPOS_FORCEDRAG    = {2} ;    (* Move non-draggable screen     *)
  1964.  
  1965. (* New for V39: Intuition supports double-buffering in screens,        *)
  1966. (* with friendly interaction with menus and certain gadgets.        *)
  1967. (* For each buffer, you need to get one of these structures        *)
  1968. (* from the AllocScreenBuffer() call.  Never allocate your        *)
  1969. (* own ScreenBuffer structures!                        *)
  1970. (*                                    *)
  1971. (* The sb_DBufInfo field is for your use.  See the graphics.library    *)
  1972. (* AllocDBufInfo() autodoc for details.                    *)
  1973.  
  1974. TYPE
  1975.   ScreenBuffer = RECORD
  1976.     sb_BitMap   : BitMapPtr   ;    (* BitMap of this buffer    *)
  1977.     sb_DBufInfo : DBufInfoPtr ;    (* DBufInfo for this buffer *)
  1978.   END ;
  1979.  
  1980. CONST
  1981. (* These are the flags that may be passed to AllocScreenBuffer(). *)
  1982.   SB_SCREEN_BITMAP    = {0} ;
  1983.   SB_COPY_BITMAP    = {1} ;
  1984.  
  1985. (* ======================================================================== *)
  1986. (* === Preferences ======================================================== *)
  1987. (* ======================================================================== *)
  1988.  
  1989. (* these are the definitions for the printer configurations *)
  1990. CONST
  1991.   FILENAME_SIZE = 30 ;    (* Filename size    *)
  1992.   DEVNAME_SIZE    = 16 ;    (* Device-name size *)
  1993.  
  1994.   POINTERSIZE    = (1+16+1) * 2 ;    (* Size of Pointer data buffer *)
  1995.  
  1996. (* These defines are for the default font size.  These actually describe the  *)
  1997. (* height of the defaults fonts.  The default font type is the topaz          *)
  1998. (* font, which is a fixed width font that can be used in either              *)
  1999. (* eighty-column or sixty-column mode.    The Preferences structure reflects    *)
  2000. (* which is currently selected by the value found in the variable FontSize,   *)
  2001. (* which may have either of the values defined below.  These values actually  *)
  2002. (* are used to select the height of the default font.  By changing the        *)
  2003. (* height, the resolution of the font changes as well.                  *)
  2004.  
  2005.   TOPAZ_EIGHTY = 8 ;
  2006.   TOPAZ_SIXTY  = 9 ;
  2007.  
  2008. (* Note:  Starting with V36, and continuing with each new version of     *)
  2009. (* Intuition, an increasing number of fields of struct Preferences     *)
  2010. (* are ignored by SetPrefs().  (Some fields are obeyed only at the     *)
  2011. (* initial SetPrefs(), which comes from the devs:system-configuration    *)
  2012. (* file).  Elements are generally superseded as new hardware or software *)
  2013. (* features demand more information than fits in struct Preferences.     *)
  2014. (* Parts of struct Preferences must be ignored so that applications     *)
  2015. (* calling GetPrefs(), modifying some other part of struct Preferences,  *)
  2016. (* then calling SetPrefs(), don't end up truncating the extended     *)
  2017. (* data.                                 *)
  2018. (*                                     *)
  2019. (* Consult the autodocs for SetPrefs() for further information as     *)
  2020. (* to which fields are not always respected.                 *)
  2021.  
  2022. TYPE
  2023.   Preferences = RECORD
  2024.     (* the default font height *)
  2025.     FontHeight    : SHORTINT ;    (* height for system default font  *)
  2026.  
  2027.     (* constant describing what's hooked up to the port *)
  2028.     PrinterPort : SHORTCARD ;    (* printer port connection       *)
  2029.  
  2030.     (* the baud rate of the port *)
  2031.     BaudRate    : CARDINAL ;    (* baud rate for the serial port   *)
  2032.  
  2033.     (* various timing rates *)
  2034.     KeyRptSpeed    : timeval ;    (* repeat speed for keyboard       *)
  2035.     KeyRptDelay    : timeval ;    (* Delay before keys repeat       *)
  2036.     DoubleClick    : timeval ;    (* Interval allowed between clicks *)
  2037.  
  2038.     (* Intuition Pointer data *)
  2039.     PointerMatrix : ARRAY [0..POINTERSIZE-1] OF CARDINAL ;
  2040.                     (* Definition of pointer sprite    *)
  2041.     XOffset    : SHORTINT ;    (* X-Offset for active 'bit'       *)
  2042.     YOffset    : SHORTINT ;    (* Y-Offset for active 'bit'       *)
  2043.     color17    : CARDINAL ;    (***********************************)
  2044.     color18    : CARDINAL ;    (* Colours for sprite pointer       *)
  2045.     color19    : CARDINAL ;    (***********************************)
  2046.     PointerTicks: CARDINAL ;    (* Sensitivity of the pointer       *)
  2047.  
  2048.     (* Workbench Screen colors *)
  2049.     color0    : CARDINAL ;    (***********************************)
  2050.     color1    : CARDINAL ;    (*  Standard default colours       *)
  2051.     color2    : CARDINAL ;    (*   Used in the Workbench       *)
  2052.     color3    : CARDINAL ;    (***********************************)
  2053.  
  2054.     (* positioning data for the Intuition View *)
  2055.     ViewXOffset : SHORTINT ;    (* Offset for top lefthand corner  *)
  2056.     ViewYOffset : SHORTINT ;    (* X and Y dimensions           *)
  2057.     ViewInitX    : INTEGER  ;    (* View initial offset values       *)
  2058.     ViewInitY    : INTEGER  ;
  2059.  
  2060.     EnableCLI    : BITSET ;    (* CLI availability switch       *)
  2061.  
  2062.     (* printer configurations *)
  2063.     PrinterType        : CARDINAL ;    (* printer type    *)
  2064.     PrinterFilename    : ARRAY [0..FILENAME_SIZE-1] OF CHAR ;
  2065.                     (* file for printer           *)
  2066.  
  2067.     (* print format and quality configurations *)
  2068.     PrintPitch        : CARDINAL ;    (* print pitch               *)
  2069.     PrintQuality    : CARDINAL ;    (* print quality           *)
  2070.     PrintSpacing    : CARDINAL ;    (* number of lines per inch       *)
  2071.     PrintLeftMargin    : CARDINAL ;    (* left margin in characters       *)
  2072.     PrintRightMargin    : CARDINAL ;    (* right margin in characters       *)
  2073.     PrintImage        : CARDINAL ;    (* positive or negative           *)
  2074.     PrintAspect        : CARDINAL ;    (* horizontal or vertical       *)
  2075.     PrintShade        : CARDINAL ;    (* b&w, half-tone, or color       *)
  2076.     PrintThreshold    : INTEGER  ;    (* darkness ctrl for b/w dumps       *)
  2077.  
  2078.     (* print paper descriptors *)
  2079.     PaperSize    : CARDINAL ;    (* paper size               *)
  2080.     PaperLength    : CARDINAL ;    (* paper length in number of lines *)
  2081.     PaperType    : CARDINAL ;    (* continuous or single sheet       *)
  2082.  
  2083.     (* Serial device settings: These are six nibble-fields in three bytes *)
  2084.     (* (these look a little strange so the defaults will map out to zero) *)
  2085.  
  2086.     SerRWBits    : SHORTCARD ;    (* upper nibble = (8-number of read bits)  *)
  2087.                 (* lower nibble = (8-number of write bits) *)
  2088.  
  2089.     SerStopBuf    : SHORTCARD ;    (* upper nibble = (number of stop bits - 1) *)
  2090.                 (* lower nibble = (table value for BufSize) *)
  2091.  
  2092.     SerParShk    : SHORTCARD ;    (* upper nibble = (value for Parity setting) *)
  2093.                 (* lower nibble = (value for Handshake mode) *)
  2094.  
  2095.     LaceWB    : SHORTSET ;    (* if workbench is to be interlaced *)
  2096.  
  2097.     Pad        : ARRAY [0..11] OF CHAR ;
  2098.     PrtDevName    : ARRAY [0..DEVNAME_SIZE-1] OF CHAR ;
  2099.                     (* device used by printer.device  *)
  2100.                 (* (omit the ".device")          *)
  2101.  
  2102.     DefaultPrtUnit : SHORTCARD ;  (* default unit opened by printer.device *)
  2103.     DefaultSerUnit : SHORTCARD ;  (* default serial unit           *)
  2104.  
  2105.     RowSizeChange    : SHORTINT ; (* affect NormalDisplayRows/Columns       *)
  2106.     ColumnSizeChange : SHORTINT ;
  2107.  
  2108.     PrintFlags       : BITSET ;     (* user preference flags              *)
  2109.     PrintMaxWidth  : CARDINAL ;     (* max width of printed picture in 10ths/in  *)
  2110.     PrintMaxHeight : CARDINAL ;     (* max height of printed picture in 10ths/in *)
  2111.     PrintDensity   : SHORTCARD ; (* print density                  *)
  2112.     PrintXOffset   : SHORTCARD ; (* offset of printed picture in 10ths/inch   *)
  2113.  
  2114.     wb_Width       : CARDINAL ;  (* override default workbench width  *)
  2115.     wb_Height       : CARDINAL ;  (* override default workbench height *)
  2116.     wb_Depth       : SHORTCARD ; (* override default workbench depth  *)
  2117.  
  2118.     ext_size       : SHORTCARD ; (* extension information -- do not touch! *)
  2119.                  (* extension size in blocks of 64 bytes   *)
  2120.   END ;
  2121.  
  2122. CONST
  2123. (* Workbench Interlace (use one bit) *)
  2124.   LACEWB        = {0} ;
  2125.   LW_RESERVED        =  1  ; (* internal use only *)
  2126.  
  2127. (* Enable_CLI    *)
  2128.   SCREEN_DRAG        = {14} ;
  2129.   MOUSE_ACCEL        = {15} ;
  2130.  
  2131. (* PrinterPort *)
  2132.   PARALLEL_PRINTER     = 000H ;
  2133.   SERIAL_PRINTER       = 001H ;
  2134.  
  2135. (* BaudRate *)
  2136.   BAUD_110        = 000H ;
  2137.   BAUD_300        = 001H ;
  2138.   BAUD_1200        = 002H ;
  2139.   BAUD_2400        = 003H ;
  2140.   BAUD_4800        = 004H ;
  2141.   BAUD_9600        = 005H ;
  2142.   BAUD_19200        = 006H ;
  2143.   BAUD_MIDI        = 007H ;
  2144.  
  2145. (* PaperType *)
  2146.   FANFOLD        = 000H ;
  2147.   SINGLE        = 080H ;
  2148.  
  2149. (* PrintPitch *)
  2150.   PICA            = 0000H ;
  2151.   ELITE            = 0400H ;
  2152.   FINE            = 0800H ;
  2153.  
  2154. (* PrintQuality *)
  2155.   DRAFT            = 0000H ;
  2156.   LETTER        = 0100H ;
  2157.  
  2158. (* PrintSpacing *)
  2159.   SIX_LPI        = 0000H ;
  2160.   EIGHT_LPI        = 0200H ;
  2161.  
  2162. (* Print Image *)
  2163.   IMAGE_POSITIVE     = 000H ;
  2164.   IMAGE_NEGATIVE     = 001H ;
  2165.  
  2166. (* PrintAspect *)
  2167.   ASPECT_HORIZ        = 000H ;
  2168.   ASPECT_VERT        = 001H ;
  2169.  
  2170. (* PrintShade *)
  2171.   SHADE_BW          = 000H ;
  2172.   SHADE_GREYSCALE     = 001H ;
  2173.   SHADE_COLOR         = 002H ;
  2174.  
  2175. (* PaperSize (all paper sizes have a zero in the lowest nybble) *)
  2176.   US_LETTER        = 000H ;
  2177.   US_LEGAL        = 010H ;
  2178.   N_TRACTOR        = 020H ;
  2179.   W_TRACTOR        = 030H ;
  2180.   CUSTOM        = 040H ;
  2181.  
  2182. (* New PaperSizes for V36: *)
  2183.   EURO_A0        = 050H ; (* European size A0: 841 x 1189 *)
  2184.   EURO_A1        = 060H ; (* European size A1: 594 x 841  *)
  2185.   EURO_A2        = 070H ; (* European size A2: 420 x 594  *)
  2186.   EURO_A3        = 080H ; (* European size A3: 297 x 420  *)
  2187.   EURO_A4        = 090H ; (* European size A4: 210 x 297  *)
  2188.   EURO_A5        = 0A0H ; (* European size A5: 148 x 210  *)
  2189.   EURO_A6        = 0B0H ; (* European size A6: 105 x 148  *)
  2190.   EURO_A7        = 0C0H ; (* European size A7: 74 x 105      *)
  2191.   EURO_A8        = 0D0H ; (* European size A8: 52 x 74      *)
  2192.  
  2193. (* PrinterType *)
  2194.   CUSTOM_NAME        = 000H ;
  2195.   ALPHA_P_101        = 001H ;
  2196.   BROTHER_15XL        = 002H ;
  2197.   CBM_MPS1000        = 003H ;
  2198.   DIAB_630        = 004H ;
  2199.   DIAB_ADV_D25        = 005H ;
  2200.   DIAB_C_150        = 006H ;
  2201.   EPSON            = 007H ;
  2202.   EPSON_JX_80        = 008H ;
  2203.   OKIMATE_20        = 009H ;
  2204.   QUME_LP_20        = 00AH ;
  2205. (* new printer entries, 3 October 1985 *)
  2206.   HP_LASERJET        = 00BH ;
  2207.   HP_LASERJET_PLUS    = 00CH ;
  2208.  
  2209. (* Serial Input Buffer Sizes *)
  2210.   SBUF_512        = 000H ;
  2211.   SBUF_1024        = 001H ;
  2212.   SBUF_2048        = 002H ;
  2213.   SBUF_4096        = 003H ;
  2214.   SBUF_8000        = 004H ;
  2215.   SBUF_16000        = 005H ;
  2216.  
  2217. (* Serial Bit Masks *)
  2218.   SREAD_BITS        = 0F0H ; (* for SerRWBits    *)
  2219.   SWRITE_BITS        = 00FH ;
  2220.  
  2221.   SSTOP_BITS        = 0F0H ; (* for SerStopBuf    *)
  2222.   SBUFSIZE_BITS        = 00FH ;
  2223.  
  2224.   SPARITY_BITS        = 0F0H ; (* for SerParShk    *)
  2225.   SHSHAKE_BITS        = 00FH ;
  2226.  
  2227. (* Serial Parity (upper nibble, after being shifted by  *)
  2228. (* macro SPARNUM() )                    *)
  2229.  
  2230.   SPARITY_NONE         = 0 ;
  2231.   SPARITY_EVEN         = 1 ;
  2232.   SPARITY_ODD         = 2 ;
  2233. (* New parity definitions for V36: *)
  2234.   SPARITY_MARK        = 3 ;
  2235.   SPARITY_SPACE         = 4 ;
  2236.  
  2237. (* Serial Handshake Mode (lower nibble, after masking using    *)
  2238. (* macro SHANKNUM() )                        *)
  2239.  
  2240.   SHSHAKE_XON        = 0 ;
  2241.   SHSHAKE_RTS        = 1 ;
  2242.   SHSHAKE_NONE        = 2 ;
  2243.  
  2244. (* new defines for PrintFlags *)
  2245.  
  2246.   CORRECT_RED        = {0} ; (* color correct red shades    *)
  2247.   CORRECT_GREEN        = {1} ; (* color correct green shades    *)
  2248.   CORRECT_BLUE        = {2} ; (* color correct blue shades    *)
  2249.  
  2250.   CENTER_IMAGE        = {3} ; (* center image on paper    *)
  2251.  
  2252.   IGNORE_DIMENSIONS       = { } ; (* ignore max width/height settings    *)
  2253.   BOUNDED_DIMENSIONS      = {4} ; (* use max width/height as boundaries    *)
  2254.   ABSOLUTE_DIMENSIONS     = {5} ; (* use max width/height as absolutes    *)
  2255.   PIXEL_DIMENSIONS        = {6} ; (* use max width/height as prt pixels    *)
  2256.   MULTIPLY_DIMENSIONS     = {7} ; (* use max width/height as multipliers    *)
  2257.  
  2258.   INTEGER_SCALING    = {8} ; (* force integer scaling        *)
  2259.  
  2260.   ORDERED_DITHERING    = { } ; (* ordered dithering            *)
  2261.   HALFTONE_DITHERING    = {9} ; (* halftone dithering            *)
  2262.   FLOYD_DITHERING    = {10}; (* Floyd-Steinberg dithering        *)
  2263.  
  2264.   ANTI_ALIAS        = {11}; (* anti-alias image            *)
  2265.   GREY_SCALE2        = {12}; (* for use with hi-res monitor        *)
  2266.  
  2267. (* masks used for checking bits *)
  2268.  
  2269.   CORRECT_RGB_MASK    = CORRECT_RED+CORRECT_GREEN+CORRECT_BLUE ;
  2270.  
  2271.   DIMENSIONS_MASK     = BOUNDED_DIMENSIONS+ABSOLUTE_DIMENSIONS+
  2272.                  PIXEL_DIMENSIONS+MULTIPLY_DIMENSIONS ;
  2273.  
  2274.   DITHERING_MASK    = HALFTONE_DITHERING+FLOYD_DITHERING ;
  2275.  
  2276. (* ========================================================================== *)
  2277. (* === Remember ============================================================= *)
  2278. (* ========================================================================== *)
  2279. (* this structure is used for remembering what memory has been allocated to   *)
  2280. (* date by a given routine, so that a premature abort or systematic exit      *)
  2281. (* can deallocate memory cleanly, easily, and completely              *)
  2282.  
  2283. TYPE
  2284.   Remember = RECORD
  2285.     NextRemember : RememberPtr ;
  2286.     RememberSize : LONGINT ;
  2287.     Memory     : ADDRESS ;
  2288.   END ;
  2289.  
  2290. (* === Color Spec ===================================================== *)
  2291. (* How to tell Intuition about RGB values for a color table entry.    *)
  2292. (* NOTE:  The way the structure was defined, the color value was    *)
  2293. (* right-justified within each UWORD.  This poses problems for        *)
  2294. (* extensibility to more bits-per-gun.    The SA_Colors32 tag to        *)
  2295. (* OpenScreenTags() provides an alternate way to specify colors        *)
  2296. (* with greater precision.                        *)
  2297.  
  2298.   ColorSpec = RECORD
  2299.     ColorIndex : INTEGER  ;
  2300.                 (* -1 terminates an array of ColorSpec    *)
  2301.     Red       : CARDINAL ;    (* only the _bottom_ 4 bits recognized  *)
  2302.     Green  : CARDINAL ;    (* only the _bottom_ 4 bits recognized  *)
  2303.     Blue   : CARDINAL ;    (* only the _bottom_ 4 bits recognized  *)
  2304.   END ;
  2305.  
  2306. (* === Easy Requester Specification =========================== *)
  2307. (* see also autodocs for EasyRequest and BuildEasyRequest    *)
  2308. (* NOTE: This structure may grow in size in the future        *)
  2309.  
  2310.   EasyStruct = RECORD
  2311.     es_StructSize   : LONGINT ;    (* should be sizeof (struct EasyStruct )*)
  2312.     es_Flags        : LONGSET ;    (* should be 0 for now            *)
  2313.     es_Title        : STRING  ;    (* title of requester window        *)
  2314.     es_TextFormat   : STRING  ;    (* 'printf' style formatting string    *)
  2315.     es_GadgetFormat : STRING  ; (* 'printf' style formatting string    *)
  2316.   END ;
  2317.  
  2318. (* ======================================================================== *)
  2319. (* === Miscellaneous ====================================================== *)
  2320. (* ======================================================================== *)
  2321.  
  2322. (* Macros *)
  2323. PROCEDURE GADGET_BOX( g : GadgetPtr ) : IBoxPtr ;
  2324. PROCEDURE IM_BOX( im : ImagePtr ) : IBoxPtr ;
  2325. PROCEDURE IM_FGPEN( im : ImagePtr ) : SHORTCARD ;
  2326. PROCEDURE IM_BGPEN( im : ImagePtr ) : SHORTCARD ;
  2327. PROCEDURE MENUNUM( n : CARDINAL ) : CARDINAL ;
  2328. PROCEDURE ITEMNUM( n : CARDINAL ) : CARDINAL ;
  2329. PROCEDURE SUBNUM( n : CARDINAL ) : CARDINAL ;
  2330. PROCEDURE SHIFTMENU( n : CARDINAL ) : CARDINAL ;
  2331. PROCEDURE SHIFTITEM( n : CARDINAL ) : CARDINAL ;
  2332. PROCEDURE SHIFTSUB( n : CARDINAL ) : CARDINAL ;
  2333. PROCEDURE FULLMENUNUM( menu, item, sub : CARDINAL ) : CARDINAL ;
  2334.  
  2335. (* = MENU STUFF =========================================================== *)
  2336. CONST
  2337.   NOMENU    = 0001FH ;
  2338.   NOITEM    = 0003FH ;
  2339.   NOSUB        = 0001FH ;
  2340.   MENUNULL    = 0FFFFH ;
  2341.  
  2342. (* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT, *)
  2343. (* I'll use a generic Width (for all resolutions) for the CheckMark.      *)
  2344. (* If COMMSEQ, likewise I'll use this generic stuff              *)
  2345.  
  2346.   CHECKWIDTH    = 19 ;
  2347.   COMMWIDTH    = 27 ;
  2348.   LOWCHECKWIDTH    = 13 ;
  2349.   LOWCOMMWIDTH    = 16 ;
  2350.  
  2351. (* these are the AlertNumber defines.  if you are calling DisplayAlert()  *)
  2352. (* the AlertNumber you supply must have the ALERT_TYPE bits set to one    *)
  2353. (* of these patterns                              *)
  2354.  
  2355.   ALERT_TYPE    = 080000000H ;
  2356.   RECOVERY_ALERT= 000000000H ;    (* the system can recover from this *)
  2357.   DEADEND_ALERT    = 080000000H ;    (* no recovery possible, this is it *)
  2358.  
  2359. (* When you're defining IntuiText for the Positive and Negative Gadgets      *)
  2360. (* created by a call to AutoRequest(), these defines will get you      *)
  2361. (* reasonable-looking text.  The only field without a define is the IText *)
  2362. (* field; you decide what text goes with the Gadget              *)
  2363.  
  2364.   AUTOFRONTPEN    =   0  ;
  2365.   AUTOBACKPEN    =   1  ;
  2366.   AUTODRAWMODE    = JAM2 ;
  2367.   AUTOLEFTEDGE    =   6  ;
  2368.   AUTOTOPEDGE    =   3  ;
  2369.   AUTOITEXTFONT    =   0  ;
  2370.   AUTONEXTTEXT    =   0  ;
  2371.  
  2372. (* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- *)
  2373.  
  2374.   SELECTUP    = (IECODE_LBUTTON + IECODE_UP_PREFIX) ;
  2375.   SELECTDOWN    = (IECODE_LBUTTON) ;
  2376.   MENUUP    = (IECODE_RBUTTON + IECODE_UP_PREFIX) ;
  2377.   MENUDOWN    = (IECODE_RBUTTON) ;
  2378.   MIDDLEUP    = (IECODE_MBUTTON + IECODE_UP_PREFIX) ;
  2379.   MIDDLEDOWN    = (IECODE_MBUTTON) ;
  2380.   ALTLEFT    = (IEQUALIFIER_LALT) ;
  2381.   ALTRIGHT    = (IEQUALIFIER_RALT) ;
  2382.   AMIGALEFT    = (IEQUALIFIER_LCOMMAND) ;
  2383.   AMIGARIGHT    = (IEQUALIFIER_RCOMMAND) ;
  2384.   AMIGAKEYS    = (AMIGALEFT + AMIGARIGHT) ;
  2385.  
  2386.   CURSORUP      = 04CH ; CURSORLEFT      = 04FH ;
  2387.   CURSORRIGHT      = 04EH ; CURSORDOWN      = 04DH ;
  2388.  
  2389.   KEYCODE_Q      = 010H ; KEYCODE_Z      = 031H ;
  2390.   KEYCODE_X      = 032H ; KEYCODE_V      = 034H ;
  2391.   KEYCODE_B      = 035H ; KEYCODE_N      = 036H ;
  2392.   KEYCODE_M      = 037H ; KEYCODE_LESS      = 038H ;
  2393.   KEYCODE_GREATER = 039H ;
  2394.  
  2395. (* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  2396.  * of the IECLASS_NEWPOINTERPOS event.    The ie_EventAddress of such
  2397.  * an event points to a TabletData structure (see below).
  2398.  *
  2399.  * The TabletData structure contains certain elements including a taglist.
  2400.  * The taglist can be used for special tablet parameters.  A tablet driver
  2401.  * should include only those tag-items the tablet supports.  An application
  2402.  * can listen for any tag-items that interest it.  Note: an application
  2403.  * must set the WA_TabletMessages attribute to TRUE to receive this
  2404.  * extended information in its IntuiMessages.
  2405.  *
  2406.  * The definitions given here MUST be followed.  Pay careful attention
  2407.  * to normalization and the interpretation of signs.
  2408.  *
  2409.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  2410.  * This unsigned value should typically be in the natural units of the
  2411.  * tablet.  You should also provide TABLETA_RangeZ.
  2412.  *
  2413.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  2414.  * Normally specified along with TABLETA_TabletZ, this allows the
  2415.  * application to scale the actual Z value across its range.
  2416.  *
  2417.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  2418.  * number should be normalized to fill a signed long integer.  Positive
  2419.  * values imply a clockwise rotation about the X-axis when viewing
  2420.  * from +X towards the origin.
  2421.  *
  2422.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  2423.  * number should be normalized to fill a signed long integer.  Positive
  2424.  * values imply a clockwise rotation about the Y-axis when viewing
  2425.  * from +Y towards the origin.
  2426.  *
  2427.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  2428.  * number should be normalized to fill a signed long integer.  Positive
  2429.  * values imply a clockwise rotation about the Z-axis when viewing
  2430.  * from +Z towards the origin.
  2431.  *
  2432.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  2433.  *    and TABLETA_AngleY attributes.    Tilting the stylus so the tip
  2434.  *    points towards increasing or decreasing X is actually a rotation
  2435.  *    around the Y-axis.  Thus, if the stylus tip points towards
  2436.  *    positive X, then that tilt is represented as a negative
  2437.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  2438.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  2439.  *
  2440.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  2441.  * should be normalized to fill a signed long integer.    Typical devices
  2442.  * won't generate negative pressure, but the possibility is not precluded.
  2443.  * The pressure threshold which is considered to cause a button-click is
  2444.  * expected to be set in a Preferences program supplied by the tablet
  2445.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  2446.  * the pressure crossed that threshold.
  2447.  *
  2448.  * TABLETA_ButtonBits:    ti_Data is a long integer whose bits are to
  2449.  * be interpreted at the state of the first 32 buttons of the tablet.
  2450.  *
  2451.  * TABLETA_InProximity:  ti_Data is a boolean.    For tablets that support
  2452.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  2453.  * when the stylus is out of proximity.  One possible use we can forsee
  2454.  * is a mouse-blanking commodity which keys off this to blank the
  2455.  * mouse.  When this tag is absent, the stylus is assumed to be
  2456.  * in proximity.
  2457.  *
  2458.  * TABLETA_ResolutionX:  ti_Data is an unsigned long integer which
  2459.  * is the x-axis resolution in dots per inch.
  2460.  *
  2461.  * TABLETA_ResolutionY:  ti_Data is an unsigned long integer which
  2462.  * is the y-axis resolution in dots per inch.
  2463.  *)
  2464.  
  2465. CONST
  2466.   TABLETA_Dummy        = (TAG_USER + 03A000H) ;
  2467.   TABLETA_TabletZ    = (TABLETA_Dummy + 001H) ;
  2468.   TABLETA_RangeZ    = (TABLETA_Dummy + 002H) ;
  2469.   TABLETA_AngleX    = (TABLETA_Dummy + 003H) ;
  2470.   TABLETA_AngleY    = (TABLETA_Dummy + 004H) ;
  2471.   TABLETA_AngleZ    = (TABLETA_Dummy + 005H) ;
  2472.   TABLETA_Pressure    = (TABLETA_Dummy + 006H) ;
  2473.   TABLETA_ButtonBits    = (TABLETA_Dummy + 007H) ;
  2474.   TABLETA_InProximity    = (TABLETA_Dummy + 008H) ;
  2475.   TABLETA_ResolutionX    = (TABLETA_Dummy + 009H) ;
  2476.   TABLETA_ResolutionY    = (TABLETA_Dummy + 00AH) ;
  2477.  
  2478. (* If your window sets WA_TabletMessages to TRUE, then it will receive    *)
  2479. (* extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData *)
  2480. (* field points at a TabletData structure.  This structure contains    *)
  2481. (* additional information about the input event.            *)
  2482.  
  2483. TYPE
  2484.   TabletData = RECORD
  2485.     (* Sub-pixel position of tablet, in screen coordinates,    *)
  2486.     (* scaled to fill a UWORD fraction:                *)
  2487.  
  2488.     td_XFraction, td_YFraction : CARDINAL ;
  2489.  
  2490.     (* Current tablet coordinates along each axis: *)
  2491.  
  2492.     td_TabletX, td_TabletY : LONGINT ;
  2493.  
  2494.     (* Tablet range along each axis.  For example, if td_TabletX *)
  2495.     (* can take values 0-999, td_RangeX should be 1000.         *)
  2496.  
  2497.     td_RangeX, td_RangeY : LONGINT ;
  2498.  
  2499.     (* Pointer to tag-list of additional tablet attributes. *)
  2500.     (* See <intuition/intuition.h> for the tag values.      *)
  2501.  
  2502.     td_TagList : TagItemPtr ;
  2503.   END ;
  2504.  
  2505. (* If a tablet driver supplies a hook for ient_CallBack, it will be
  2506.  * invoked in the standard hook manner.  A0 will point to the Hook
  2507.  * itself, A2 will point to the InputEvent that was sent, and
  2508.  * A1 will point to a TabletHookData structure.  The InputEvent's
  2509.  * ie_EventAddress field points at the IENewTablet structure that
  2510.  * the driver supplied.
  2511.  *
  2512.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  2513.  * should scale the ient_TabletX and ient_TabletY fields and store the
  2514.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  2515.  * ient_ScaledYFraction.
  2516.  *
  2517.  * The tablet hook must currently return NULL.    This is the only
  2518.  * acceptable return-value under V39.
  2519.  *)
  2520.  
  2521.   TabletHookData = RECORD
  2522.     (* Pointer to the active screen:                    *)
  2523.     (* Note: if there are no open screens, thd_Screen will be NULL.    *)
  2524.     (* thd_Width and thd_Height will then describe an NTSC 640x400    *)
  2525.     (* screen.    Please scale accordingly.                *)
  2526.  
  2527.     thd_Screen    : ScreenPtr ;
  2528.  
  2529.     (* The width and height (measured in pixels of the active screen)    *)
  2530.     (* that your are to scale to:                    *)
  2531.  
  2532.     thd_Width    : LONGINT ;
  2533.     thd_Height    : LONGINT ;
  2534.  
  2535.     (* Non-zero if the screen or something about the screen        *)
  2536.     (* changed since the last time you were invoked:            *)
  2537.  
  2538.     thd_ScreenChanged : LONGINT ;
  2539.   END ;
  2540.  
  2541.  
  2542. TYPE
  2543.   StringExtend = RECORD
  2544.     (* display specifications *)
  2545.     Font    : TextFontPtr ;    (* must be an open Font (not TextAttr)     *)
  2546.     Pens    : ARRAY [0..1] OF SHORTCARD ;
  2547.                     (* color of text/backgroun         *)
  2548.     ActivePens    : ARRAY [0..1] OF SHORTCARD ;
  2549.                     (* colors when gadget is active         *)
  2550.     (* edit specifications    *)
  2551.     InitialModes: LONGSET ;    (* initial mode flags, below         *)
  2552.     EditHook    : HookPtr ;    (* if non-NULL, must supply WorkBuffer     *)
  2553.     WorkBuffer    : ADDRESS ;    (* must be as large as StringInfo.Buffer *)
  2554.     Reserved    : ARRAY [0..3] OF LONGINT ;
  2555.                 (* set to 0                 *)
  2556.   END ;
  2557.  
  2558.   SGWork = RECORD
  2559.     (* set up when gadget is first activated *)
  2560.     Gadget    : GadgetPtr ;     (* the contestant itself    *)
  2561.     StringInfo    : StringInfoPtr ;(* easy access to sinfo    *)
  2562.     WorkBuffer    : ADDRESS ;     (* intuition's planned result    *)
  2563.     PrevBuffer    : ADDRESS ;     (* what was there before    *)
  2564.     Modes    : LONGSET ;     (* current mode        *)
  2565.     (* modified for each input event *)
  2566.     IEvent    : InputEventPtr ;(* actual event: do not change    *)
  2567.     Code    : CARDINAL ;     (* character code, if one byte    *)
  2568.     BufferPos    : INTEGER  ;     (* cursor position        *)
  2569.     NumChars    : INTEGER  ;
  2570.     Actions    : LONGSET  ;     (* what Intuition will do    *)
  2571.     LongInt    : LONGINT  ;     (* temp storage for longint    *)
  2572.     GadgetInfo    : GadgetInfoPtr ;(* see cghooks.h        *)
  2573.     EditOp    : CARDINAL     ; (* from constants below    *)
  2574.   END ;
  2575.  
  2576. (* SGWork.EditOp -                            *)
  2577. (* These values indicate what basic type of operation the global    *)
  2578. (* editing hook has performed on the string before your gadget's custom    *)
  2579. (* editing hook gets called.  You do not have to be concerned with the    *)
  2580. (* value your custom hook leaves in the EditOp field, only if you    *)
  2581. (* write a global editing hook.                        *)
  2582. (*                                    *)
  2583. (* For most of these general edit operations, you'll want to compare    *)
  2584. (* the BufferPos and NumChars of the StringInfo (before global editing)    *)
  2585. (* and SGWork (after global editing).                    *)
  2586.  
  2587. CONST
  2588.   EO_NOOP     = (00001H) ; (* did nothing                      *)
  2589.  
  2590.   EO_DELBACKWARD = (00002H) ; (* deleted some chars (maybe 0).              *)
  2591.  
  2592.   EO_DELFORWARD     = (00003H) ; (* deleted some characters under and in front of*)
  2593.                     (* the cursor                      *)
  2594.  
  2595.   EO_MOVECURSOR    = (00004H) ; (* moved the cursor                      *)
  2596.  
  2597.   EO_ENTER    = (00005H) ; (* "enter" or "return" key, terminate          *)
  2598.  
  2599.   EO_RESET    = (00006H) ; (* current Intuition-style undo              *)
  2600.  
  2601.   EO_REPLACECHAR= (00007H) ; (* replaced one character and (maybe) advanced   *)
  2602.                    (* cursor                          *)
  2603.  
  2604.   EO_INSERTCHAR    = (00008H) ; (* inserted one char into string or added one    *)
  2605.                    (* at end                          *)
  2606.  
  2607.   EO_BADFORMAT    = (00009H) ; (* didn't like the text data, e.g., Bad LONGINT  *)
  2608.  
  2609.   EO_BIGCHANGE    = (0000AH) ; (* unused by Intuition                  *)
  2610.                  (* complete or major change to the text, e.g.new *)
  2611.                  (* string                          *)
  2612.  
  2613.   EO_UNDO    = (0000BH) ; (* unused by Intuition                  *)
  2614.                  (* some other style of undo              *)
  2615.  
  2616.   EO_CLEAR    = (0000CH) ; (* clear the string                  *)
  2617.  
  2618.   EO_SPECIAL    = (0000DH) ; (* unused by Intuition                  *)
  2619.                  (* some operation that doesn't fit into the      *)
  2620.                  (* categories here                      *)
  2621.  
  2622. (* Mode Flags definitions (ONLY first group allowed as InitialModes)    *)
  2623.  
  2624.   SGM_REPLACE    = {0} ;    (* replace mode            *)
  2625.  
  2626. (* please initialize StringInfo with in-range value of BufferPos *)
  2627. (* if you are using SGM_REPLACE mode.                 *)
  2628.  
  2629.   SGM_FIXEDFIELD = {1} ;(* fixed length buffer        *)
  2630.             (* always set SGM_REPLACE, too    *)
  2631.  
  2632.   SGM_NOFILTER    = {2} ;    (* don't filter control chars    *)
  2633.  
  2634. (* SGM_EXITHELP is new for V37, and ignored by V36: *)
  2635.   SGM_EXITHELP    = {7} ;    (* exit with code = 05FH if HELP hit *)
  2636.  
  2637. (* These Mode Flags are for internal use only *)
  2638.   SGM_NOCHANGE    = {3} ;    (* no edit changes yet        *)
  2639.   SGM_NOWORKB    = {4} ;    (* Buffer == PrevBuffer        *)
  2640.   SGM_CONTROL    = {5} ;    (* control char escape mode    *)
  2641.   SGM_LONGINT    = {6} ;    (* an intuition longint gadget    *)
  2642.  
  2643. (* String Gadget Action Flags (put in SGWork.Actions by EditHook) *)
  2644.  
  2645.   SGA_USE    = {0} ;    (* use contents of SGWork        *)
  2646.   SGA_END    = {1} ;    (* terminate gadget, code in Code field    *)
  2647.   SGA_BEEP    = {2} ;    (* flash the screen for the user    *)
  2648.   SGA_REUSE    = {3} ;    (* reuse input event            *)
  2649.   SGA_REDISPLAY    = {4} ;    (* gadget visuals changed        *)
  2650.  
  2651. (* New for V37: *)
  2652.   SGA_NEXTACTIVE = {5} ; (* Make next possible gadget active.     *)
  2653.   SGA_PREVACTIVE = {6} ; (* Make previous possible gadget active *)
  2654.  
  2655. (* function id for only existing custom string gadget edit hook    *)
  2656.  
  2657.   SGH_KEY    = 1 ;    (* process editing keystroke        *)
  2658.   SGH_CLICK    = 2 ;    (* process mouse click cursor position    *)
  2659.  
  2660. (* Here's a brief summary of how the custom string gadget edit hook works:
  2661.  *    You provide a hook in StringInfo.Extension.EditHook.
  2662.  *    The hook is called in the standard way with the 'object'
  2663.  *    a pointer to SGWork, and the 'message' a pointer to a command
  2664.  *    block, starting either with (longword) SGH_KEY, SGH_CLICK,
  2665.  *    or something new.
  2666.  *
  2667.  *    You return 0 if you don't understand the command (SGH_KEY is
  2668.  *    required and assumed).    Return non-zero if you implement the
  2669.  *    command.
  2670.  *
  2671.  *   SGH_KEY:
  2672.  *    There are no parameters following the command longword.
  2673.  *
  2674.  *    Intuition will put its idea of proper values in the SGWork
  2675.  *    before calling you, and if you leave SGA_USE set in the
  2676.  *    SGWork.Actions field, Intuition will use the values
  2677.  *    found in SGWork fields WorkBuffer, NumChars, BufferPos,
  2678.  *    and LongInt, copying the WorkBuffer back to the StringInfo
  2679.  *    Buffer.
  2680.  *
  2681.  *    NOTE WELL: You may NOT change other SGWork fields.
  2682.  *
  2683.  *    If you clear SGA_USE, the string gadget will be unchanged.
  2684.  *
  2685.  *    If you set SGA_END, Intuition will terminate the activation
  2686.  *    of the string gadget.  If you also set SGA_REUSE, Intuition
  2687.  *    will reuse the input event after it deactivates your gadget.
  2688.  *
  2689.  *    In this case, Intuition will put the value found in SGWork.Code
  2690.  *    into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  2691.  *    sends to the application.
  2692.  *
  2693.  *    If you set SGA_BEEP, Intuition will call DisplayBeep(); use
  2694.  *    this if the user has typed in error, or buffer is full.
  2695.  *
  2696.  *    Set SGA_REDISPLAY if the changes to the gadget warrant a
  2697.  *    gadget redisplay.  Note: cursor movement requires a redisplay.
  2698.  *
  2699.  *    Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  2700.  *    when you set SGA_END.  This tells Intuition that you want
  2701.  *    the next or previous gadget with GFLG_TABCYCLE to be activated.
  2702.  *
  2703.  *   SGH_CLICK:
  2704.  *    This hook command is called when Intuition wants to position
  2705.  *    the cursor in response to a mouse click in the string gadget.
  2706.  *
  2707.  *    Again, here are no parameters following the command longword.
  2708.  *
  2709.  *    This time, Intuition has already calculated the mouse position
  2710.  *    character cell and put it in SGWork.BufferPos.    The previous
  2711.  *    BufferPos value remains in the SGWork.StringInfo.BufferPos.
  2712.  *
  2713.  *    Intuition will again use the SGWork fields listed above for
  2714.  *    SGH_KEY.  One restriction is that you are NOT allowed to set
  2715.  *    SGA_END or SGA_REUSE for this command.    Intuition will not
  2716.  *    stand for a gadget which goes inactive when you click in it.
  2717.  *
  2718.  *    You should always leave the SGA_REDISPLAY flag set, since Intuition
  2719.  *    uses this processing when activating a string gadget.
  2720.  *)
  2721.  
  2722. (* Package of information passed to custom and 'boopsi'        *)
  2723. (* gadget "hook" functions.  This structure is READ ONLY.    *)
  2724.  
  2725. TYPE
  2726.   GadgetInfo = RECORD
  2727.  
  2728.     gi_Screen     : ScreenPtr ;
  2729.     gi_Window     : WindowPtr ;       (* null for screen gadgets    *)
  2730.     gi_Requester : RequesterPtr ;  (* null if not GTYP_REQGADGET *)
  2731.  
  2732.     (* rendering information:                     *)
  2733.     (* don't use these without cloning/locking.             *)
  2734.     (* Official way is to call ObtainRPort()             *)
  2735.  
  2736.     gi_RastPort : RastPortPtr ;
  2737.     gi_Layer    : LayerPtr ;
  2738.  
  2739.     (* copy of dimensions of screen/window/g00/req(/group)         *)
  2740.     (* that gadget resides in.    Left/Top of this box is             *)
  2741.     (* offset from window mouse coordinates to gadget coordinates     *)
  2742.     (*    screen gadgets:            0,0 (from screen coords)      *)
  2743.     (*    window gadgets (no g00):    0,0                 *)
  2744.     (*    GTYP_GZZGADGETs (borderlayer):    0,0                  *)
  2745.     (*    GZZ innerlayer gadget:        borderleft, bordertop         *)
  2746.     (*    Requester gadgets:        reqleft, reqtop             *)
  2747.  
  2748.     gi_Domain    : IBox ;
  2749.  
  2750.     (* these are the pens for the window or screen        *)
  2751.  
  2752.     gi_Pens    : RECORD DetailPen , BlockPen : SHORTCARD END ;
  2753.  
  2754.     (* the Detail and Block pens in gi_DrInfo->dri_Pens[] are    *)
  2755.     (* for the screen.    Use the above for window-sensitive    *)
  2756.     (* colors.                            *)
  2757.  
  2758.     gi_DrInfo    : DrawInfoPtr ;
  2759.  
  2760.     (* reserved space: this structure is extensible        *)
  2761.     (* anyway, but using these saves some recompilation        *)
  2762.  
  2763.     gi_Reserved : ARRAY [0..5] OF LONGINT ;
  2764.   END ;
  2765.  
  2766. (*** system private data structure for now ***)
  2767. (* prop gadget extra info    *)
  2768.  
  2769.   PGX = RECORD
  2770.     pgx_Container : IBox ;
  2771.     pgx_NewKnob   : IBox ;
  2772.   END ;
  2773.  
  2774. (* CUSTOM_HOOK casts MutualExclude for easy assignment of a hook *)
  2775. (* pointer to the unused MutualExclude field of a custom gadget     *)
  2776.  
  2777. PROCEDURE CUSTOM_HOOK( gad : ADDRESS ) : HookPtr ;
  2778.  
  2779. (* ======================================================================== *)
  2780. (* === IntuitionBase ====================================================== *)
  2781. (* ======================================================================== *)
  2782. (*                                        *)
  2783. (* Be sure to protect yourself against someone modifying these data as        *)
  2784. (* you look at them.  This is done by calling:                    *)
  2785. (*                                        *)
  2786. (* lock = LockIBase(0), which returns a ULONG.    When done call            *)
  2787. (* UnlockIBase(lock) where lock is what LockIBase() returned.            *)
  2788.  
  2789. (* This structure is strictly READ ONLY *)
  2790.  
  2791. TYPE
  2792.   IntuitionBaseRec = RECORD
  2793.     LibNode     : Library ;
  2794.     ViewLord     : View ;
  2795.     ActiveWindow : WindowPtr ;
  2796.     ActiveScreen : ScreenPtr ;
  2797.  
  2798.     (* the FirstScreen variable points to the frontmost Screen.  Screens are *)
  2799.     (* then maintained in a front to back order using Screen.NextScreen      *)
  2800.  
  2801.     FirstScreen  : ScreenPtr ;  (* for linked list of all screens     *)
  2802.     Flags     : LONGSET ;    (* values are all system private     *)
  2803.     MouseY     : INTEGER ;
  2804.     MouseX     : INTEGER ;    (* note "backwards" order of these     *)
  2805.     Seconds     : LONGINT ;    (* timestamp of most current input event *)
  2806.     Micros     : LONGINT ;    (* timestamp of most current input event *)
  2807.  
  2808.     (* I told you this was private.                     *)
  2809.     (* The data beyond this point has changed, is changing, and         *)
  2810.     (* will continue to change.                         *)
  2811.   END ;
  2812.  
  2813. VAR
  2814.   IntuitionBase : IntuitionBasePtr ;
  2815.  
  2816. (*============================================================================*)
  2817. (*                                          *)
  2818. (* 1.  The traditional identifiers for gadget Flags, Activation, and Type,    *)
  2819. (* and for window Flags and IDCMP classes.  They are defined in terms          *)
  2820. (* of their new versions, which serve to prevent confusion between          *)
  2821. (* similar-sounding but different identifiers (like IDCMP_WINDOWACTIVE          *)
  2822. (* and WFLG_ACTIVATE).                                  *)
  2823. (*                                          *)
  2824. (* 2.  Some tag names and constants whose labels were adjusted after V36.     *)
  2825.  
  2826. CONST
  2827. (* V34-style Gadget->Flags names: *)
  2828.  
  2829.   GADGHIGHBITS    = GFLG_GADGHIGHBITS ;    GADGHCOMP    = GFLG_GADGHCOMP ;
  2830.   GADGHBOX    = GFLG_GADGHBOX ;    GADGHIMAGE    = GFLG_GADGHIMAGE ;
  2831.   GADGHNONE    = GFLG_GADGHNONE ;    GADGIMAGE    = GFLG_GADGIMAGE ;
  2832.   GRELBOTTOM    = GFLG_RELBOTTOM ;    GRELRIGHT    = GFLG_RELRIGHT ;
  2833.   GRELWIDTH    = GFLG_RELWIDTH ;    GRELHEIGHT    = GFLG_RELHEIGHT ;
  2834.   SELECTED    = GFLG_SELECTED ;    GADGDISABLED    = GFLG_DISABLED ;
  2835.   LABELMASK    = GFLG_LABELMASK ;    LABELITEXT    = GFLG_LABELITEXT ;
  2836.   LABELSTRING    = GFLG_LABELSTRING ;    LABELIMAGE    = GFLG_LABELIMAGE ;
  2837.  
  2838. (* V34-style Gadget->Activation flag names: *)
  2839.  
  2840.   RELVERIFY    = GACT_RELVERIFY ;    GADGIMMEDIATE    = GACT_IMMEDIATE ;
  2841.   ENDGADGET    = GACT_ENDGADGET ;    FOLLOWMOUSE    = GACT_FOLLOWMOUSE ;
  2842.   RIGHTBORDER    = GACT_RIGHTBORDER ;    LEFTBORDER    = GACT_LEFTBORDER ;
  2843.   TOPBORDER    = GACT_TOPBORDER ;    BOTTOMBORDER    = GACT_BOTTOMBORDER ;
  2844.   BORDERSNIFF    = GACT_BORDERSNIFF ;    TOGGLESELECT    = GACT_TOGGLESELECT ;
  2845.   BOOLEXTEND    = GACT_BOOLEXTEND ;    STRINGLEFT    = GACT_STRINGLEFT ;
  2846.   STRINGCENTER    = GACT_STRINGCENTER ;    STRINGRIGHT    = GACT_STRINGRIGHT ;
  2847.   ALTKEYMAP    = GACT_ALTKEYMAP ;    STRINGEXTEND    = GACT_STRINGEXTEND ;
  2848.   ACTIVEGADGET    = GACT_ACTIVEGADGET ;
  2849.  
  2850. (* V34-style Gadget->Type names: *)
  2851.  
  2852.   GADGETTYPE    = GTYP_GADGETTYPE ;    SYSGADGET    = GTYP_SYSGADGET ;
  2853.   SCRGADGET    = GTYP_SCRGADGET ;    GZZGADGET    = GTYP_GZZGADGET ;
  2854.   REQGADGET    = GTYP_REQGADGET ;    SIZING        = GTYP_SIZING ;
  2855.   WDRAGGING    = GTYP_WDRAGGING ;    SDRAGGING    = GTYP_SDRAGGING ;
  2856.   WUPFRONT    = GTYP_WUPFRONT ;    SUPFRONT    = GTYP_SUPFRONT ;
  2857.   WDOWNBACK    = GTYP_WDOWNBACK ;    SDOWNBACK    = GTYP_SDOWNBACK ;
  2858.   CLOSE        = GTYP_CLOSE ;        BOOLGADGET    = GTYP_BOOLGADGET ;
  2859.   GADGET0002    = GTYP_GADGET0002 ;    PROPGADGET    = GTYP_PROPGADGET ;
  2860.   STRGADGET    = GTYP_STRGADGET ;    CUSTOMGADGET    = GTYP_CUSTOMGADGET ;
  2861.   GTYPEMASK    = GTYP_GTYPEMASK ;
  2862.  
  2863. (* V34-style IDCMP class names: *)
  2864.  
  2865.   SIZEVERIFY    = IDCMP_SIZEVERIFY ;    NEWSIZE        = IDCMP_NEWSIZE ;
  2866.   REFRESHWINDOW    = IDCMP_REFRESHWINDOW ;    MOUSEBUTTONS    = IDCMP_MOUSEBUTTONS ;
  2867.   MOUSEMOVE    = IDCMP_MOUSEMOVE ;    GADGETDOWN    = IDCMP_GADGETDOWN ;
  2868.   GADGETUP    = IDCMP_GADGETUP ;    REQSET        = IDCMP_REQSET ;
  2869.   MENUPICK    = IDCMP_MENUPICK ;    CLOSEWINDOW    = IDCMP_CLOSEWINDOW ;
  2870.   RAWKEY    = IDCMP_RAWKEY ;    REQVERIFY    = IDCMP_REQVERIFY ;
  2871.   REQCLEAR    = IDCMP_REQCLEAR ;    MENUVERIFY    = IDCMP_MENUVERIFY ;
  2872.   NEWPREFS    = IDCMP_NEWPREFS ;    DISKINSERTED    = IDCMP_DISKINSERTED ;
  2873.   DISKREMOVED    = IDCMP_DISKREMOVED ;    WBENCHMESSAGE    = IDCMP_WBENCHMESSAGE ;
  2874.   ACTIVEWINDOW    = IDCMP_ACTIVEWINDOW ;    INACTIVEWINDOW    = IDCMP_INACTIVEWINDOW ;
  2875.   DELTAMOVE    = IDCMP_DELTAMOVE ;    VANILLAKEY    = IDCMP_VANILLAKEY ;
  2876.   INTUITICKS    = IDCMP_INTUITICKS ;    IDCMPUPDATE    = IDCMP_IDCMPUPDATE ;
  2877.   MENUHELP    = IDCMP_MENUHELP ;    CHANGEWINDOW    = IDCMP_CHANGEWINDOW ;
  2878.   LONELYMESSAGE    = IDCMP_LONELYMESSAGE ;
  2879.  
  2880. (* V34-style Window->Flags names: *)
  2881.  
  2882.   WINDOWSIZING    = WFLG_SIZEGADGET ;    WINDOWDRAG    = WFLG_DRAGBAR ;
  2883.   WINDOWDEPTH    = WFLG_DEPTHGADGET ;    WINDOWCLOSE    = WFLG_CLOSEGADGET ;
  2884.   SIZEBRIGHT    = WFLG_SIZEBRIGHT ;    SIZEBBOTTOM    = WFLG_SIZEBBOTTOM ;
  2885.   REFRESHBITS    = WFLG_REFRESHBITS ;    SMART_REFRESH    = WFLG_SMART_REFRESH ;
  2886.   SIMPLE_REFRESH= WFLG_SIMPLE_REFRESH ;    SUPER_BITMAP    = WFLG_SUPER_BITMAP ;
  2887.   OTHER_REFRESH    = WFLG_OTHER_REFRESH ;    BACKDROP    = WFLG_BACKDROP ;
  2888.   REPORTMOUSE    = WFLG_REPORTMOUSE ;    GIMMEZEROZERO    = WFLG_GIMMEZEROZERO ;
  2889.   BORDERLESS    = WFLG_BORDERLESS ;    ACTIVATE    = WFLG_ACTIVATE ;
  2890.   WINDOWACTIVE    = WFLG_WINDOWACTIVE ;    INREQUEST    = WFLG_INREQUEST ;
  2891.   MENUSTATE    = WFLG_MENUSTATE ;    RMBTRAP        = WFLG_RMBTRAP ;
  2892.   NOCAREREFRESH    = WFLG_NOCAREREFRESH ;    WINDOWREFRESH    = WFLG_WINDOWREFRESH ;
  2893.   WBENCHWINDOW    = WFLG_WBENCHWINDOW ;    WINDOWTICKED    = WFLG_WINDOWTICKED ;
  2894.   NW_EXTENDED    = WFLG_NW_EXTENDED ;    VISITOR        = WFLG_VISITOR ;
  2895.   ZOOMED    = WFLG_ZOOMED ;        HASZOOM        = WFLG_HASZOOM ;
  2896.  
  2897. (* These are the obsolete identifiers for the various DrawInfo pens.    *)
  2898. (* Use the uppercase versions in instead.                *)
  2899.  
  2900.  
  2901.   detailPen    = DETAILPEN ;        blockPen    = BLOCKPEN ;
  2902.   textPen    = TEXTPEN ;        shinePen    = SHINEPEN ;
  2903.   shadowPen    = SHADOWPEN ;        hifillPen    = FILLPEN ;
  2904.   hifilltextPen    = FILLTEXTPEN ;        backgroundPen    = BACKGROUNDPEN ;
  2905.   hilighttextPen= HIGHLIGHTTEXTPEN ;    numDrIPens    = NUMDRIPENS ;
  2906.  
  2907. (*============================================================================*)
  2908.  
  2909. (* Modula-2 implementation init. code *)
  2910. PROCEDURE Intuition_BEGIN( version : CARDINAL ) ;
  2911.  
  2912. (*============================================================================*)
  2913.  
  2914. (* Public functions OpenIntuition() and Intuition() are intentionally    *)
  2915. (* not documented.                            *)
  2916.  
  2917. PROCEDURE OpenIntuition( ) ;
  2918. PROCEDURE Intuition( iEvent : InputEventPtr ) ;
  2919.  
  2920. PROCEDURE AddGadget( window   : WindowPtr ;
  2921.              gadget   : GadgetPtr ;
  2922.              position : LONGINT ) : CARDINAL ;
  2923.  
  2924. PROCEDURE ClearDMRequest( window : WindowPtr ) : BOOLEAN ;
  2925. PROCEDURE ClearMenuStrip( window : WindowPtr ) ;
  2926. PROCEDURE ClearPointer( window : WindowPtr ) ;
  2927. PROCEDURE CloseScreen( screen : ScreenPtr ) : BOOLEAN ;
  2928. PROCEDURE CloseWindow( window : WindowPtr ) ;
  2929. PROCEDURE CloseWorkBench( ) : LONGINT ;
  2930. PROCEDURE CurrentTime( VAR seconds , micros : LONGINT  );
  2931.  
  2932. PROCEDURE DisplayAlert( alertNumber : LONGINT ;
  2933.             string        : STRING ;
  2934.             height        : LONGINT ) : BOOLEAN ;
  2935.  
  2936. PROCEDURE DisplayBeep( screen : ScreenPtr );
  2937. PROCEDURE DoubleClick( sSeconds,sMicros,cSeconds,cMicros : LONGINT ) : BOOLEAN ;
  2938.  
  2939. PROCEDURE DrawBorder( rp : RastPortPtr ;
  2940.               border : BorderPtr ;
  2941.               leftOffset, topOffset : LONGINT ) ;
  2942.  
  2943. PROCEDURE DrawImage( rp : RastPortPtr ;
  2944.              image : ImagePtr ;
  2945.              leftOffset, topOffset : LONGINT ) ;
  2946.  
  2947. PROCEDURE EndRequest( requester : RequesterPtr ; window : WindowPtr ) ;
  2948. PROCEDURE GetDefPrefs( prefs: PreferencesPtr ; size: LONGINT ) : PreferencesPtr;
  2949. PROCEDURE GetPrefs( prefs : PreferencesPtr ; size : LONGINT ) : PreferencesPtr ;
  2950. PROCEDURE InitRequester( requester : RequesterPtr ) ;
  2951. PROCEDURE ItemAddress( menuStrip: MenuPtr ; menuNumber: LONGINT ): MenuItemPtr ;
  2952. PROCEDURE ModifyIDCMP( window : WindowPtr ; flags : LONGSET ) : BOOLEAN ;
  2953.  
  2954. PROCEDURE ModifyProp( gadget : GadgetPtr ;
  2955.               window : WindowPtr ;
  2956.               requester : RequesterPtr ;
  2957.               flags : BITSET ;
  2958.               horizPot,vertPot,horizBody,vertBody : LONGINT ) ;
  2959.  
  2960. PROCEDURE MoveScreen( screen : ScreenPtr ; dx, dy : LONGINT ) ;
  2961. PROCEDURE MoveWindow( window : WindowPtr ; dx, dy : LONGINT ) ;
  2962.  
  2963. PROCEDURE OffGadget( gadget    : GadgetPtr ;
  2964.              window    : WindowPtr ;
  2965.              requester : RequesterPtr ) ;
  2966.  
  2967. PROCEDURE OffMenu( window : WindowPtr ; menuNumber : LONGINT );
  2968.  
  2969. PROCEDURE OnGadget( gadget    : GadgetPtr ;
  2970.             window    : WindowPtr ;
  2971.             requester : RequesterPtr ) ;
  2972.  
  2973. PROCEDURE OnMenu( window : WindowPtr ; menuNumber : LONGINT );
  2974. PROCEDURE OpenScreen( VAR newScreen : NewScreen ) : ScreenPtr ;
  2975. PROCEDURE OpenWindow( VAR newWindow : NewWindow ) : WindowPtr ;
  2976. PROCEDURE OpenWorkBench( ) : LONGINT ;
  2977.  
  2978. PROCEDURE PrintIText( rp: RastPortPtr ;
  2979.               iText : IntuiTextPtr ;
  2980.               left, top : LONGINT ) ;
  2981.  
  2982. PROCEDURE RefreshGadgets( gadget    : GadgetPtr ;
  2983.               window    : WindowPtr ;
  2984.               requester : RequesterPtr ) ;
  2985.  
  2986. PROCEDURE RemoveGadget( window : WindowPtr ;
  2987.             gadget : GadgetPtr ) : CARDINAL ;
  2988.  
  2989. (* The official calling sequence for ReportMouse is given below.      *)
  2990. (* Note the register order.  For the complete story, read the ReportMouse *)
  2991. (* autodoc.                                  *)
  2992.  
  2993. PROCEDURE ReportMouse( flag : BOOLEAN ; window : WindowPtr ) ;
  2994. PROCEDURE ReportMouse1( window : WindowPtr ; flag : BOOLEAN ) ;
  2995. PROCEDURE Request( requester : RequesterPtr ; window : WindowPtr ) : BOOLEAN ;
  2996. PROCEDURE ScreenToBack( screen : ScreenPtr ) ;
  2997. PROCEDURE ScreenToFront( screen : ScreenPtr ) ;
  2998. PROCEDURE SetDMRequest( window: WindowPtr ; requester: RequesterPtr ): BOOLEAN ;
  2999. PROCEDURE SetMenuStrip( window : WindowPtr ; menu : MenuPtr ) : BOOLEAN ;
  3000.  
  3001. PROCEDURE SetPointer( window : WindowPtr ; pointer : ADDRESS ;
  3002.               height , width, xOffset, yOffset : LONGINT ) ;
  3003.  
  3004. PROCEDURE SetWindowTitles( window : WindowPtr ;
  3005.                windowTitle , screenTitle : STRING ) ;
  3006.  
  3007. PROCEDURE ShowTitle( screen : ScreenPtr ; showIt : LONGINT ) ;
  3008. PROCEDURE SizeWindow( window : WindowPtr ; dx , dy : LONGINT ) ;
  3009. PROCEDURE ViewAddress( ) : ViewPtr ;
  3010. PROCEDURE ViewPortAddress( window : WindowPtr ) : ViewPortPtr ;
  3011. PROCEDURE WindowToBack( window : WindowPtr ) ;
  3012. PROCEDURE WindowToFront( window : WindowPtr ) ;
  3013.  
  3014. PROCEDURE WindowLimits( window : WindowPtr ;
  3015.             widthMin , heightMin : LONGINT ;
  3016.             widthMax , heightMax : LONGINT ) : BOOLEAN ;
  3017.  
  3018. (*--- start of next generation of names -------------------------------------*)
  3019.  
  3020. PROCEDURE SetPrefs( prefs : PreferencesPtr ;
  3021.             size : LONGINT ;
  3022.             inform : LONGINT ) : PreferencesPtr ;
  3023.  
  3024. (*--- start of next next generation of names --------------------------------*)
  3025.  
  3026. PROCEDURE IntuiTextLength( iText : IntuiTextPtr ) : LONGINT ;
  3027. PROCEDURE WBenchToBack( ) ;
  3028. PROCEDURE WBenchToFront( ) ;
  3029.  
  3030. (*--- start of next next next generation of names ---------------------------*)
  3031.  
  3032. PROCEDURE AutoRequest( window : WindowPtr ;
  3033.         body, posText, negText : IntuiTextPtr ;
  3034.         pFlag : LONGSET ;
  3035.         nFlag : LONGSET ;
  3036.         width , height : LONGINT ) : BOOLEAN ;
  3037.  
  3038. PROCEDURE BeginRefresh( window : WindowPtr );
  3039.  
  3040. PROCEDURE BuildSysRequest( window : WindowPtr ;
  3041.                body , posText , negText : IntuiTextPtr ;
  3042.                flags  : LONGSET ;
  3043.                width  : LONGINT ;
  3044.                height : LONGINT  ) : WindowPtr ;
  3045.  
  3046. PROCEDURE EndRefresh( window : WindowPtr ; complete : LONGINT ) ;
  3047. PROCEDURE FreeSysRequest( window : WindowPtr ) ;
  3048.  
  3049. (* The return codes for MakeScreen(), RemakeDisplay(), and RethinkDisplay() *)
  3050. (* are only valid under V39 and greater.  Do not examine them when running  *)
  3051. (* on pre-V39 systems!                                *)
  3052.  
  3053. PROCEDURE MakeScreen( screen : ScreenPtr ) : LONGINT ;
  3054. PROCEDURE RemakeDisplay( ) : LONGINT ;
  3055. PROCEDURE RethinkDisplay( ) : LONGINT ;
  3056.  
  3057. (*--- start of next next next next generation of names ----------------------*)
  3058.  
  3059. PROCEDURE AllocRemember( VAR rememberKey : RememberPtr ;
  3060.                  size  : LONGINT ;
  3061.                  flags : LONGSET ) : ADDRESS ;
  3062.  
  3063. (* Public function AlohaWorkbench() is intentionally not documented *)
  3064.  
  3065. PROCEDURE AlohaWorkbench( wbport : LONGINT ) ;
  3066. PROCEDURE FreeRemember( VAR rememberKey : RememberPtr ; reallyForget : LONGINT);
  3067.  
  3068. (*--- start of 15 Nov 85 names ------------------------*)
  3069.  
  3070. PROCEDURE LockIBase( dontknow : LONGINT ) : LONGINT ;
  3071. PROCEDURE UnlockIBase( ibLock : LONGINT );
  3072.  
  3073. (*--- functions in V33 or higher (Release 1.2) ---*)
  3074.  
  3075. PROCEDURE GetScreenData( buffer : ADDRESS ;
  3076.              size   : LONGINT ;
  3077.              type   : BITSET ;
  3078.              screen : ScreenPtr ) : LONGINT ;
  3079.  
  3080. PROCEDURE RefreshGList( gadget      : GadgetPtr ;
  3081.             window      : WindowPtr ;
  3082.             requester : RequesterPtr ;
  3083.             numGad       : LONGINT ) ;
  3084.  
  3085. PROCEDURE AddGList( window    : WindowPtr ;
  3086.             gadget    : GadgetPtr ;
  3087.             position    : LONGINT ;
  3088.             numGad    : LONGINT ;
  3089.             requester    : RequesterPtr ) : CARDINAL ;
  3090.  
  3091. PROCEDURE RemoveGList( remPtr : WindowPtr ;
  3092.                gadget : GadgetPtr ;
  3093.                numGad : LONGINT ) : CARDINAL ;
  3094.  
  3095. PROCEDURE ActivateWindow( window : WindowPtr ) ;
  3096. PROCEDURE RefreshWindowFrame( window : WindowPtr ) ;
  3097.  
  3098. PROCEDURE ActivateGadget( gadget    : GadgetPtr ;
  3099.               window    : WindowPtr ;
  3100.               requester : RequesterPtr ) : BOOLEAN ;
  3101.  
  3102. PROCEDURE NewModifyProp( gadget    : GadgetPtr ;
  3103.              window    : WindowPtr ;
  3104.              requester : RequesterPtr ;
  3105.              flags       : BITSET ;
  3106.              horizPot, vertPot, horizBody, vertBody : LONGINT ;
  3107.              numGad       : LONGINT ) ;
  3108.  
  3109. (*--- functions in V36 or higher (Release 2.0) ---*)
  3110.  
  3111. PROCEDURE QueryOverscan( displayID : LONGINT ;
  3112.              rect       : RectanglePtr ;
  3113.              oScanType : LONGINT ) ;
  3114.  
  3115. PROCEDURE MoveWindowInFrontOf( window , behindWindow : WindowPtr ) ;
  3116. PROCEDURE ChangeWindowBox( window : WindowPtr ; left,top,width,height:LONGINT );
  3117. PROCEDURE SetEditHook( hook : HookPtr ) : HookPtr ;
  3118. PROCEDURE SetMouseQueue( window : WindowPtr ; queueLength : LONGINT ): LONGINT ;
  3119. PROCEDURE ZipWindow( window : WindowPtr ) ;
  3120.  
  3121. (* public screens *)
  3122.  
  3123. PROCEDURE LockPubScreen( name : STRING ) : ScreenPtr ;
  3124. PROCEDURE UnlockPubScreen( name : STRING ; screen : ScreenPtr );
  3125. PROCEDURE LockPubScreenList( ) : ListPtr ;
  3126. PROCEDURE UnlockPubScreenList( ) ;
  3127. PROCEDURE NextPubScreen( screen : ScreenPtr ; namebuf : STRING ) : STRING ;
  3128. PROCEDURE SetDefaultPubScreen( name : STRING ) ;
  3129. PROCEDURE SetPubScreenModes( modes : BITSET ) : BITSET ;
  3130. PROCEDURE PubScreenStatus( screen    : ScreenPtr ;
  3131.                statusFlags    : BITSET ) : BITSET ;
  3132.  
  3133. PROCEDURE GetDefaultPubScreen( nameBuffer : STRING ) ;
  3134.  
  3135. PROCEDURE ObtainGIRPort( gInfo : GadgetInfoPtr ) : RastPortPtr ;
  3136. PROCEDURE ReleaseGIRPort( rp : RastPortPtr ) ;
  3137.  
  3138. PROCEDURE GadgetMouse(  gadget       : GadgetPtr ;
  3139.             gInfo       : GadgetInfoPtr ;
  3140.             mousePoint : ADDRESS ) ;
  3141.  
  3142. PROCEDURE EasyRequestArgs( window     : WindowPtr ;
  3143.                easyStruct : EasyStructPtr ;
  3144.                idcmpPtr   : ADDRESS ;
  3145.                args          : ADDRESS ) : LONGINT ;
  3146.  
  3147. PROCEDURE EasyRequest( window     : WindowPtr ;
  3148.                easyStruct : EasyStructPtr ;
  3149.                idcmpPtr   : ADDRESS ; .. ) : LONGINT ;
  3150.  
  3151. PROCEDURE BuildEasyRequestArgs( window     : WindowPtr ;
  3152.                 easyStruct : EasyStructPtr ;
  3153.                     idcmp       : LONGSET ;
  3154.                 args       : ADDRESS ) : WindowPtr ;
  3155.  
  3156. PROCEDURE BuildEasyRequest( window    : WindowPtr ;
  3157.                 easyStruct    : EasyStructPtr ;
  3158.                 idcmp    : LONGSET ; .. ) : WindowPtr ;
  3159.  
  3160. PROCEDURE SysReqHandler( window       : WindowPtr ;
  3161.              idcmpPtr  : ADDRESS ;
  3162.              waitInput : LONGINT ) : LONGINT ;
  3163.  
  3164. PROCEDURE OpenWindowTagList( newWindow : NewWindowPtr ;
  3165.                  tagList   : TagItemPtr ) : WindowPtr ;
  3166.  
  3167. PROCEDURE OpenWindowTags( newWindow : NewWindowPtr ;
  3168.               tag1Type  : LONGINT ; .. ) : WindowPtr ;
  3169.  
  3170. PROCEDURE OpenScreenTagList( newScreen : NewScreenPtr ;
  3171.                  tagList   : TagItemPtr ) : ScreenPtr ;
  3172.  
  3173. PROCEDURE OpenScreenTags( newScreen : NewScreenPtr ;
  3174.               tag1Type  : LONGINT ; .. ) : ScreenPtr ;
  3175.  
  3176. (* new Image functions *)
  3177.  
  3178. PROCEDURE DrawImageState( rp         : RastPortPtr ;
  3179.               image         : ImagePtr ;
  3180.               leftOffset : LONGINT ;
  3181.               topOffset  : LONGINT ;
  3182.               state         : LONGINT ;
  3183.               drawInfo   : DrawInfoPtr );
  3184.  
  3185. PROCEDURE PointInImage( point : LONGINT ; image : ImagePtr ) : BOOLEAN ;
  3186.  
  3187. PROCEDURE EraseImage( rp    : RastPortPtr ;
  3188.               image : ImagePtr ;
  3189.               leftOffset, topOffset : LONGINT );
  3190.  
  3191. PROCEDURE GetScreenDrawInfo( screen : ScreenPtr ) : DrawInfoPtr ;
  3192.  
  3193. PROCEDURE FreeScreenDrawInfo( screen   : ScreenPtr ;
  3194.                   drawInfo : DrawInfoPtr ) ;
  3195.  
  3196. PROCEDURE ResetMenuStrip( window : WindowPtr ; menu : MenuPtr ) : BOOLEAN ;
  3197.  
  3198. (*--- functions in V39 or higher (Release 3) ---*)
  3199.  
  3200. PROCEDURE AllocScreenBuffer( sc : ScreenPtr ;
  3201.                  bm : BitMapPtr ;
  3202.                  flags : SHORTSET ) : ScreenBufferPtr ;
  3203.  
  3204. PROCEDURE FreeScreenBuffer( sc : ScreenPtr ; sb : ScreenBufferPtr );
  3205. PROCEDURE ChangeScreenBuffer( sc : ScreenPtr ; sb : ScreenBufferPtr ): LONGINT ;
  3206. PROCEDURE ScreenDepth( screen: ScreenPtr ; flags: SHORTSET ; reserved :ADDRESS);
  3207.  
  3208. PROCEDURE ScreenPosition( screen : ScreenPtr ;
  3209.               flags  : SHORTSET ;
  3210.               x1,y1,x2,y2 : LONGINT ) ;
  3211.  
  3212. PROCEDURE ScrollWindowRaster( win : WindowPtr ;
  3213.                   dx,dy,xMin,yMin,xMax,yMax : LONGINT ) ;
  3214.  
  3215. PROCEDURE LendMenus( fromwindow,towindow : WindowPtr ) ;
  3216.  
  3217. PROCEDURE SetWindowPointerA( win : WindowPtr ; taglist : TagItemPtr ) ;
  3218. PROCEDURE SetWindowPointer( win : WindowPtr ; tag1 : LONGINT ; .. ) ;
  3219.  
  3220. PROCEDURE TimedDisplayAlert( alertNumber : LONGINT ;
  3221.                  string     : STRING ;
  3222.                  height     : LONGINT ;
  3223.                  time     : LONGINT ) : BOOLEAN ;
  3224.  
  3225. PROCEDURE HelpControl( win : WindowPtr ; flags : SHORTSET ) ;
  3226.  
  3227. CONST
  3228.   LONGINT = GACT_LONGINT ; (* defined down here to prevent occlusion :^) *)
  3229.  
  3230. END Intuition.
  3231.